$ cat taint_test.pm
package taint_test;
use strict;
use warnings;
chdir +(split /:/, $ENV{PATH})[0];
####
$ cat check_taint_1.pl
use strict;
use warnings;
$ENV{PATH} = '/bin:/usr/bin';
use lib '.';
use taint_test;
##
##
$ perl -T check_taint_1.pl
Insecure dependency in chdir while running with -T switch at taint_test.pm line 6.
Compilation failed in require at check_taint_1.pl line 6.
BEGIN failed--compilation aborted at check_taint_1.pl line 6.
$
##
##
$ cat check_taint_2.pl
use strict;
use warnings;
BEGIN { $ENV{PATH} = '/bin:/usr/bin'; }
use lib '.';
use taint_test;
##
##
$ perl -T check_taint_2.pl
$
##
##
$ cat check_taint_3.pl
use strict;
use warnings;
use lib '.';
use taint_test;
BEGIN { $ENV{PATH} = '/bin:/usr/bin'; }
##
##
$ perl -T check_taint_3.pl
Insecure dependency in chdir while running with -T switch at taint_test.pm line 6.
Compilation failed in require at check_taint_3.pl line 5.
BEGIN failed--compilation aborted at check_taint_3.pl line 5.
$