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