To set $! to a constant 1, you need to give the typeglob a reference to it:
What I meant was not to assign the constant 1 to $!, but to make $! an alias for $1, which is read only too:
*! = 1; "text" =~ /.(..)/; print "$!\n"; __END__ ex
It's notable that the typeglob assignment to constant destroys $!'s dual value magic:
$ perl -e'$! = 1; print "$!\n"'
I don't get this. There's no typeglob assignment in your example. Maybe a typo? If you meant *! = 2 then you'll get an alias for $2, as expected. So no $! magic. (Thank you anyway for remembering me that there's a CUFP I wanted to share :)).
--
David Serrano
In reply to Re^2: eval segfaults when $@ isn't writable
by Hue-Bond
in thread eval segfaults when $@ isn't writable
by Hue-Bond
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |