in reply to Re: eval segfaults when $@ isn't writable
in thread eval segfaults when $@ isn't writable
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
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: eval segfaults when $@ isn't writable
by Zaxo (Archbishop) on Jul 04, 2006 at 15:31 UTC | |
by Hue-Bond (Priest) on Jul 04, 2006 at 15:42 UTC |