|
|
| Pathologically Eclectic Rubbish Lister | |
| PerlMonks |
Re: Use of "die" in OO modulesby jettero (Monsignor) |
| on Jan 18, 2007 at 14:03 UTC ( [id://595315]=note: print w/replies, xml ) | Need Help?? |
This is an archived low-energy page for bots and other anonmyous visitors. Please sign up if you are a human and want to interact.
I tend to use various methods from Carp when I'm building OO things. I can die places my module is broken and croak places where the caller did it wrong. There are a lot of choices in Carp, but I think croak is probably what you need. I figure the caller can always eval { $object->something } if they need to. UPDATE: The more I think about it though, I really only die (croak) when arguments passed differ unusuably from the documentation. -Paul
In Section
Seekers of Perl Wisdom
|
|
||||||||||||||||||||||||