$ perl5.10.0 -ce '1/0'
-e syntax OK
$ perl5.8.8 -ce '1/0'
Illegal division by zero at -e line 1.
(I think it was intentionally removed in newer perls because it could break code even if it's not reachable; consider this example:
my $DEBUG = 0;
...
if ($DEBUG) {
$verbosity = 10 / $DEBUG;
}
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). |