Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
PerlMonks  

Re: Checking to see if Taint mode is enabled

by Thelonius (Priest)
on Mar 17, 2007 at 01:07 UTC ( #605251=note: print w/ replies, xml ) Need Help??


in reply to Checking to see if Taint mode is enabled

${^TAINT}

Reflects if taint mode is on or off. 1 for on (the program was run with -T), 0 for off, -1 when only taint warnings are enabled (i.e. with -t or -TU).

In Perl 5.8.


Comment on Re: Checking to see if Taint mode is enabled
Re^2: Checking to see if Taint mode is enabled
by Burak (Chaplain) on Mar 17, 2007 at 12:23 UTC
    You have to use that new global inside an eval for backwards compatibility:
    sub is_tainted { my $taint; if ( $] >= 5.008 ) { $taint = eval '${^TAINT}'; } else { # some work around ... } $taint; }

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://605251]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others meditating upon the Monastery: (4)
As of 2015-07-04 23:51 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (60 votes), past polls