Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

Re: Use of "die" in OO modules

by jettero (Monsignor)
on Jan 18, 2007 at 19:03 UTC ( #595315=note: print w/replies, xml ) Need Help??


in reply to Use of "die" in OO modules

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

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://595315]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others romping around the Monastery: (8)
As of 2019-11-18 14:52 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Strict and warnings: which comes first?



    Results (90 votes). Check out past polls.

    Notices?