13 # Historically constant folding was performed by evaluating the ops, and if
14 # they threw an exception compilation failed. This was seen as buggy, because
15 # even illegal constants in unreachable code would cause failure. So now
16 # illegal expressions are reported at runtime, if the expression is reached,
17 # making constant folding consistent with many other languages, and purely an
18 # optimisation rather than a behaviour change.
21 $a = eval '$b = 0/0 if 0; 3';
26 $a = eval 'if ($b) {return sqrt -3} 3';
31 $b = eval q{if ($b) {return log 0} 4};