There are interesting definitions of try and catch to be seen around the monastery, but they all boil down to the construction I show.use Errno; OPEN: eval { open FH, '<', 'directory/myfile' or die $!; }; if ($@) { { $@ == EACCES and die $@; $@ == ENFILE and sleep(1), goto OPEN; warn $@; } }
After Compline,
Zaxo
In reply to Re: Exception handling - try Catch Method
by Zaxo
in thread Exception handling - try Catch Method
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |