Interesting. Division by zero is intentionally deferred to compile time.
$ perl -c -e'3/0' -e syntax OK $ perl -e'3/0' Illegal division by zero at -e line 1.
Yet chop is constant folded even though that always results in an exception.
Update: Ah! The exception is probably not from constant folding. It's probably a compile-time requirement for an lvalue.
$ perl -e'chop "fred"' Can't modify constant item in chop at -e line 1, at EOF Execution of -e aborted due to compilation errors.
runs afoul the same check as
$ perl -e'"fred" = $_' Can't modify constant item in scalar assignment at -e line 1, at EOF Execution of -e aborted due to compilation errors.
In reply to Re^2: Why isn't a fatal error trappable?
by ikegami
in thread Why isn't a fatal error trappable?
by perl-diddler
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |