go ahead... be a heretic | |
PerlMonks |
Re: Dangerous diamonds!by diotalevi (Canon) |
on May 22, 2003 at 15:27 UTC ( [id://260108]=note: print w/replies, xml ) | Need Help?? |
This is a short scratch list of easily implementable ideas for defending against readline(*ARGV). The ultimate form would be a module which when loaded subsequently "fixes" everything else. I'm imagining it could be used like perl -MSafeARGV -ne '...'. This "fix" should have no effect any future fixing of this behaviour in the actual codebase. Idea #0die("Unsafe readline(*ARGV)") when readline(*ARGV) is detected:
Idea #1Override readline() and pass the filenames to sysopen() instead. Or detect GvNAME for the passed in filehandle and die("Unsafe readline(*ARGV)") if *ARGV is detected.
Idea #2Alter the optree so that to get the effect of overriding readline() without actually doing that. This would get around the nullifying effects of multiple readline() overriding modules. Ok, this is harder, would require some tuits, and leaves anything less than 5.8.0 out in the cold (B::Generate is only for 5.8.0 and above).
In Section
Meditations
|
|