in reply to eval segfaults when $@ isn't writable
To set $! to a constant 1, you need to give the typeglob a reference to it:
It's notable that the typeglob assignment to constant destroys $!'s dual value magic:$ perl -Mwarnings -Mstrict -e'BEGIN { *! = \1; open my $fd, "< nonexis +tent"; print "$!\n"; }' 1
$ perl -e'$! = 1; print "$!\n"' Operation not permitted
I don't know whether the segfault is justified or a bug or simply undefined behavior. Just setting *@ = \1 (or 1) does not fire the segfault. I expect that die has some eval-like tendencies.
After Compline,
Zaxo
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: eval segfaults when $@ isn't writable
by Hue-Bond (Priest) on Jul 04, 2006 at 10:22 UTC | |
by Zaxo (Archbishop) on Jul 04, 2006 at 15:31 UTC | |
by Hue-Bond (Priest) on Jul 04, 2006 at 15:42 UTC |