Commit | Line | Data |
---|---|---|
f4a2945e JH |
1 | #!./perl -T |
2 | ||
3 | BEGIN { | |
4 | chdir 't' if -d 't'; | |
5 | @INC = '../lib'; | |
6 | } | |
7 | ||
8 | use lib qw(blib/lib blib/arch); | |
9 | use Scalar::Util qw(tainted); | |
10 | use Config; | |
11 | ||
12 | print "1..5\n"; | |
13 | ||
14 | print "not " if tainted(1); | |
15 | print "ok 1\n"; | |
16 | ||
17 | my $var = 2; | |
18 | ||
19 | print "not " if tainted($var); | |
20 | print "ok 2\n"; | |
21 | ||
22 | my $key = (keys %ENV)[0]; | |
23 | ||
24 | $var = $ENV{$key}; | |
25 | ||
26 | print "not " unless tainted($var); | |
27 | print "ok 3\n"; | |
28 | ||
29 | print "not " unless tainted($ENV{$key}); | |
30 | print "ok 4\n"; | |
31 | ||
32 | print "not " if @ARGV and not tainted($ARGV[0]); | |
33 | print "ok 5\n"; |