Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:

In node How can I tell if a variable is tainted? the docu says there is no -w clean way to detect taintedness. However when I tried
sub taintedness { !eval { eval substr(join("",@_),0,0)."1" } }
no -w warning popped up. Does this mean this way to test for taintedness is unreliable? Or should there be a warning, that was somehow forgotten?

Edit by dws for tag cleanup

Replies are listed 'Best First'.
Re: -w clean detect taint?
by samtregar (Abbot) on May 02, 2002 at 17:42 UTC
    How about using the Taint module on CPAN. It offers a tainted() function that should do what you want. And can you beat the price?

    -sam

    UPDATE: I mean the Taint by Dan Sugalski. If you just ask CPAN.pm to install Taint you'll get one by Tom Phoenix which fails tests on 5.6.1 and, even worse, isn't free software! It's restricted to being used only for "TESTING AND DEVELOPMENT PURPOSES" whatever that means. Yeesh.

    Even worse, the Taint I meant is baked too. The archive unpacks to all lowercase files. And fixing that, it fails to build under 5.6.1.

    I give up.

      You see the price is easily beaten(bitten?:-). But if that had answered the questions about the documentation and the warnings, which is what I'm really after, I wouldn't mind.