Sounds good; but, if I add
Internals::SvREADONLY($_, 0);
to the code I gave above, immediately before the line $_ = 'fred';, I still get:
1:03 >perl 723_SoPW.pl literal1 Modification of a read-only value attempted at 723_SoPW.pl line 26. 1:03 >perl -v This is perl 5, version 18, subversion 1 (v5.18.1) built for MSWin32-x +86-multi-thread-64int ...
Also, where and how can I learn about a feature that is “intentionally-undocumented”? (This is a serious question!)
| Athanasius <°(((>< contra mundum | Iustus alius egestas vitae, eros Piratica, |
In reply to Re^4: How to safely use $_ in a library function?
by Athanasius
in thread How to safely use $_ in a library function?
by perl-diddler
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |