Commit | Line | Data |
6a724e38 |
1 | #!./perl -Tw |
2 | # [perl #33173] shellwords.pl and tainting |
3 | |
4 | BEGIN { |
5 | chdir 't' if -d 't'; |
6 | @INC = '../lib'; |
7 | require Config; |
8 | if ($Config::Config{extensions} !~ /\bList\/Util\b/) { |
9 | print "1..0 # Skip: Scalar::Util was not built\n"; |
10 | exit 0; |
11 | } |
12 | } |
13 | |
14 | use Text::ParseWords qw(shellwords old_shellwords); |
15 | use Scalar::Util qw(tainted); |
16 | |
17 | print "1..2\n"; |
18 | |
19 | print "not " if grep { not tainted($_) } shellwords("$0$^X"); |
20 | print "ok 1\n"; |
21 | |
22 | print "not " if grep { not tainted($_) } old_shellwords("$0$^X"); |
23 | print "ok 2\n"; |