Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister

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.


Log In?

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

How do I use this? | Other CB clients
Other Users?
Others wandering the Monastery: (3)
As of 2020-10-25 23:51 GMT
Find Nodes?
    Voting Booth?
    My favourite web site is:

    Results (249 votes). Check out past polls.