if( $@ =~ /some error stuff/ ) { warn "error stuff occurred"; } else { warn "some other message" ; }
As I said I usually just do
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.if($@) { Oops; }
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.
In reply to Re^3: Do you use an exception class in your Perl programs? Why or why not?
by zwon
in thread Do you use an exception class in your Perl programs? Why or why not?
by TGI
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |