in reply to Catching a 'division by zero' error with Exception::Class
The exception even happens before the eval block is entered. This is because perl calculates immediate expressions during compile time. This should demonstrate it:
$ perl -lwe 'eval{0/0}' Illegal division by zero at -e line 1.
To work around that, you can try putting 0 into a variable.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Catching a 'division by zero' error with Exception::Class
by moritz (Cardinal) on Sep 15, 2008 at 15:45 UTC |