O_OBJECT uses warn() not croak(), why? 
Author Message
 O_OBJECT uses warn() not croak(), why?

All of the types in Dean Roehrich's perlobject.map do something like

    warn( \"${Package}::$func_name() -- $var is not a blessed SV reference\" );

when checking the type of the incoming argument.  That is, they send a
warning to stderr and immediately return undef from the function.

Why don't they croak()?  All the other places in Perl (including the
standard typemap) die if called invalidly (

    sub foo {


) and that makes sense to me.  This code is instead doing basically

    sub foo {

            carp "Invalid usage";

and I don't understand why.  I see disadvantages and no advantage.  What
am I missing?

Roderick Schertler

Wed, 01 Sep 1999 03:00:00 GMT  
 [ 1 post ] 

 Relevant Pages 

1. why does strict not warn about shaddowing declarations ?

2. making croak _not_ act like confess

3. Using croak produces unwanted backtrace

4. Ever Wonder Why Not Everyone Uses Modules?

5. Ever Wonder Why Not Everyone Uses Modules?

6. Why the warning message

7. Why this warning?

8. Why no warning with -w

9. Why does this give a warning!

10. Warning disappears when require goes inside BEGIN - why?

11. Perl5 vs. MajorDomo (WARNING: NOT COMPATIBLE YET)

12. Warning: kids do not try this at home. :-)


Powered by phpBB® Forum Software