Do you know where your variables are? | |
PerlMonks |
Re: How to prevent references from stringifying?by xmath (Hermit) |
on Oct 03, 2004 at 14:57 UTC ( [id://396016]=note: print w/replies, xml ) | Need Help?? |
I just checked the perl source. I don't see any way of doing this for general references without patching perl. The good news is that's it's easy to patch, so if you're comfortable with recompiling your perl to debug your problem, it's an option.
For perl 5.8.5:
This still allows stringification of compiled regexen, or when overloading is in place. If you want to disallow stringification in those cases too (so, for all references), you can instead do:
UPDATE: Just in case you're unfamiliar with applying a patch: unpack the perl 5.8.5 source, save one of the above snippets as "patchfile", execute (in the unpacked perl dir) the following command: patch < path/to/patchfile and then compile perl normally
In Section
Seekers of Perl Wisdom
|
|