Deprecate assignment to $[
[p5sagit/p5-mst-13.2.git] / lib / Text / ParseWords / taint.t
CommitLineData
6a724e38 1#!./perl -Tw
2# [perl #33173] shellwords.pl and tainting
3
4BEGIN {
9480d411 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 }
6a724e38 14 }
15}
16
17use Text::ParseWords qw(shellwords old_shellwords);
18use Scalar::Util qw(tainted);
19
20print "1..2\n";
21
22print "not " if grep { not tainted($_) } shellwords("$0$^X");
23print "ok 1\n";
24
25print "not " if grep { not tainted($_) } old_shellwords("$0$^X");
26print "ok 2\n";