Deprecate assignment to $[
[p5sagit/p5-mst-13.2.git] / lib / Text / ParseWords / taint.t
1 #!./perl -Tw
2 # [perl #33173] shellwords.pl and tainting
3
4 BEGIN {
5     if ( $ENV{PERL_CORE} ) {
6         chdir 't' if -d 't';
7         @INC = '../lib';
8         require Config;
9         no warnings 'once';
10         if ($Config::Config{extensions} !~ /\bList\/Util\b/) {
11             print "1..0 # Skip: Scalar::Util was not built\n";
12             exit 0;
13         }
14     }
15 }
16
17 use Text::ParseWords qw(shellwords old_shellwords);
18 use Scalar::Util qw(tainted);
19
20 print "1..2\n";
21
22 print "not " if grep { not tainted($_) } shellwords("$0$^X");
23 print "ok 1\n";
24
25 print "not " if grep { not tainted($_) } old_shellwords("$0$^X");
26 print "ok 2\n";