in reply to Is there a way to catch an error within a module?
Catching errors in Perl is done with the block form of eval. Something like:
There are modules to sugar the syntax; search for "error" and "exception" on CPAN.eval { code_that_dies; } if ( $@ ne '' ) { code_to_recover_from_code_that_dies; }
Be well,
rir
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Is there a way to catch an error within a module?
by Anonymous Monk on Mar 23, 2008 at 09:27 UTC |