in reply to How can I get a Perl script to run even if it encounters an Error?
The camel book has this to say:
Since eval traps otherwise-fatal errors, it is useful for determining whether a particular feature (such as a socket or symlink) is implemented. In fact, eval is the way to do all exception handling in Perl.
In other words, ...
eval { do_stuff(); } if (not $@) { print "Successful!\n"; } else print "Error: $@\n"; }
$;=sub{$/};@;=map{my($a,$b)=($_,$;);$;=sub{$a.$b->()}} split//,".rekcah lreP rehtona tsuJ";$\=$ ;->();print$/
|
|---|