Perl try, catch, eval, die, warn, carp http://www.dzone.com/snippets/trycatch-simple-try-catch http://c2.com/cgi/wiki?ExceptionHandlingInPerl http://www.caveofprogramming.com/perl/perl-eval-using-eval-to-run-code-and-trap-errors-in-perl/ *using* http://search.cpan.org/~doy/Try-Tiny-0.12/lib/Try/Tiny.pm http://www.perlmonks.org/?node_id=384038 http://search.cpan.org/~ash/TryCatch-1.003002/lib/TryCatch.pm http://www.perl.com/pub/2002/11/14/exception.html http://perldoc.perl.org/Carp.html Perl's Warn and Die Signals http://www.perlmonks.org/?node_id=51097 http://www.perlmonks.org/?node=warn http://www.perlmonks.org/?node=die # warn user (from perspective of caller) carp "string trimmed to 80 chars"; # die of errors (from perspective of caller) croak "We're outta here!"; # die of errors with stack backtrace confess "not implemented"; # cluck, longmess and shortmess not exported by default use Carp qw(cluck longmess shortmess); cluck "This is how we got here!"; $long_message = longmess( "message from cluck() or confess()" ); $short_message = shortmess( "message from carp() or croak()" ); #perl #programming