11 ::ok($@, '... got an error because strict is on');
12 ::like($@, qr/Global symbol \"\$foo\" requires explicit package name at/, '... got the right error');
16 local $SIG{__WARN__} = sub { $warn = $_[0] };
18 ::ok(!$warn, '... no warning yet');
20 eval 'my $bar = 1 + "hello"';
22 ::ok($warn, '... got a warning');
23 ::like($warn, qr/Argument \"hello\" isn\'t numeric in addition \(\+\)/, '.. and it is the right warning');
33 ::ok($@, '... got an error because strict is on');
34 ::like($@, qr/Global symbol \"\$foo\" requires explicit package name at/, '... got the right error');
38 local $SIG{__WARN__} = sub { $warn = $_[0] };
40 ::ok(!$warn, '... no warning yet');
42 eval 'my $bar = 1 + "hello"';
44 ::ok($warn, '... got a warning');
45 ::like($warn, qr/Argument \"hello\" isn\'t numeric in addition \(\+\)/, '.. and it is the right warning');
55 ::ok($@, '... got an error because strict is on');
56 ::like($@, qr/Global symbol \"\$foo\" requires explicit package name at/, '... got the right error');
60 local $SIG{__WARN__} = sub { $warn = $_[0] };
62 ::ok(!$warn, '... no warning yet');
64 eval 'my $bar = 1 + "hello"';
66 ::ok($warn, '... got a warning');
67 ::like($warn, qr/Argument \"hello\" isn\'t numeric in addition \(\+\)/, '.. and it is the right warning');