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

Re: getting 2 things done at once with Class::Base

by Mutant (Priest)
on Oct 31, 2007 at 17:02 UTC ( [id://648303]=note: print w/replies, xml ) Need Help??


in reply to getting 2 things done at once with Class::Base

For parameter errors, I prefer to throw an exception (well, a croak, which is as close to an exception as Perl gets). It prevents the caller from making stupid mistakes (like not passing that parameter at all), but still allows them to wrap it in an eval{} if they need to gracefully handle edge cases where that parameter wasn't set for some reason. (Even in those cases, they probably want to know about the error somehow, because it's likely a bug. This parameter is mandatory, so presumably we can't do anything without it).

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others perusing the Monastery: (5)
As of 2024-04-19 07:34 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found