in reply to Re: Question about eval
in thread Question about eval
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"; }
|
|---|