1#!./perl -Tw
2# [perl #33173] shellwords.pl and tainting
3
4BEGIN {
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
14use Text::ParseWords qw(shellwords old_shellwords);
15use Scalar::Util qw(tainted);
16
17print "1..2\n";
18
19print "not " if grep { not tainted($_) } shellwords("$0$^X");
20print "ok 1\n";
21
22print "not " if grep { not tainted($_) } old_shellwords("$0$^X");
23print "ok 2\n";
24