Don't ask to ask, just ask | |
PerlMonks |
Re^2: Catching a 'division by zero' error with Exception::Classby moritz (Cardinal) |
on Sep 15, 2008 at 15:45 UTC ( [id://711488]=note: print w/replies, xml ) | Need Help?? |
The exception even happens before the eval block is entered. This is because perl calculates immediate expressions during compile time. That's only true for older perls:
(I think it was intentionally removed in newer perls because it could break code even if it's not reachable; consider this example:
in which case constant folding might break things). (Update: in that last example there is no constant folding at all, because variables are not constant folded. ikegami suggested to use constant DEBUG => 0; instead, which should better demonstrate what I was thinking about).
In Section
Seekers of Perl Wisdom
|
|