For more, search for "exception" on CPAN; there are several modules that provide more elaborate exception handling mechanisms.# some code that might fail eval { open MYFILE, "> some_file.txt" or die $!; ... close MYFILE; }; # catch the "exception" if ($@) { print "Errors during file operation: $@\n"; }
In reply to Re^2: Question about eval
by lbjay
in thread Question about eval
by tiny_tim
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |