Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

Re^3: Do you use an exception class in your Perl programs? Why or why not?

by zwon (Abbot)
on Mar 14, 2010 at 10:14 UTC ( [id://828539]=note: print w/replies, xml ) Need Help??


in reply to Re^2: Do you use an exception class in your Perl programs? Why or why not?
in thread Do you use an exception class in your Perl programs? Why or why not?

if( $@ =~ /some error stuff/ ) { warn "error stuff occurred"; } else { warn "some other message" ; }

As I said I usually just do

if($@) { Oops; }
but now you mentioned it and I remember one case when I have to examine $@ content deeper. But usually I'm avoiding this, particularly because I don't see the way to do it clean.
I feel like Perl exceptions are kind of like Perl OO in general.
I feel that too. The problem is that $@ may contain any object, there's no standard interface to it. If there will be a module that change this situation, that would be great.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others pondering the Monastery: (4)
As of 2024-04-25 23:20 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found