-#!./perl -tw
+#!./perl -t
BEGIN {
chdir 't';
require './test.pl';
}
-plan tests => 10;
+plan tests => 11;
my $Perl = which_perl();
local $SIG{__WARN__} = sub { $warning = join "\n", @_; };
my $Tmsg = 'while running with -t switch';
-ok( ${^TAINT}, '${^TAINT} defined' );
+is( ${^TAINT}, -1, '${^TAINT} == -1' );
-my $out = `$Perl -le "print q{Hello}"`;
+my $out = `$Perl -le "print q(Hello)"`;
is( $out, "Hello\n", '`` worked' );
like( $warning, qr/^Insecure .* $Tmsg/, ' taint warn' );
{
no warnings 'taint';
$warning = '';
- my $out = `$Perl -le "print q{Hello}"`;
+ my $out = `$Perl -le "print q(Hello)"`;
is( $out, "Hello\n", '`` worked' );
is( $warning, '', ' no warnings "taint"' );
}
like( $warning, qr/^Insecure dependency in unlink $Tmsg/,
'unlink() taint warn' );
ok( !-e $file, 'unlink worked' );
+
+ok( !$^W, "-t doesn't enable regular warnings" );