Why? If you're using a simple -n/-p one-liner from the CLI, you can still do that with -T.
This
perl -pe 's/#.*$//'
now becomes
perl -Tpe 'BEGIN { $ENV{PATH} = "" } s/#.*$//'
Here's the deal:
- I agree that the one-liner still runs fine, but the shorthand notation is defeated.
- I agree that taint is a good thing, but I don't need its power & nit-pickiness for such a common, simple operation.
- I need to be able to whip up many safe read-only operations quickly. The current magic-diamond behavior is causing worries for me.
Yes, but it can be anticipated by the person running the program.
How? By checking the expanded filenames manually? I pass my filter to a co-worker in good spirit. "What, she ran it on a filename that ended with pipe-char "|"? Shame on her! for not knowing better that that means it will magically run a shell progra.... with 2-argument ope....."
OK, ok. I pass my
tainted filter to a co-worker in good spirit. "What, she got some Insecure dependency message? It only did half the files? Oh, she must have ran into a filename that ended with pipe-char "|". Shame on her! for not knowing better that that means Perl is in taint mode which checks for... among other things... so that it doesn't run a shell progra.... with 2-argument ope.... to get around this whole stinki...."
Eyes will glaze over at the explanations above, or ignorance is bliss. Either way, Perl gets a bad rep.
That really isn't any different from:
No, it
is different. Once again, your example is an
explicit call to
unlink. The magic-diamond
implicitly performs
arbitrary shell commands. "Arbitrary shell commands" is much worse than "fixed, predetermined perl function (unlink) call".