- my $taint_mode;
- {
- open my $fh, '<', $file or last;
- my $first = <$fh>;
- close $fh;
- if ($first and my ($args) = $first =~ /^\s*#\s*!\s*perl\s*(.*)/) {
- $taint_mode = 1 if $args =~ /(?:^|\s)-T(?:$|\s)/;
- }
- }
-
- require Test::Valgrind::Command;
- my $cmd = Test::Valgrind::Command->new(
- command => 'Perl',
- args => [ '-MTest::Valgrind=run,1', (('-T') x!! $taint_mode), $file ],
- );
-