4 chdir 't' and @INC = '../lib' if $ENV{PERL_CORE};
10 print "not " unless shift;
11 print "ok $t # ", shift, "\n";
18 unless (eval 'use open ":std"; 1') {
19 # pretend that open.pm is present
20 $INC{'open.pm'} = 'open.pm';
21 eval 'sub open::foo{}'; # Just in case...
25 ok( eval "use if ($v_minus > \$]), strict => 'subs'; \${'f'} = 12" eq 12,
26 '"use if" with a false condition, fake pragma');
28 ok( eval "use if ($v_minus > \$]), strict => 'refs'; \${'f'} = 12" eq 12,
29 '"use if" with a false condition and a pragma');
31 ok( eval "use if ($v_plus > \$]), strict => 'subs'; \${'f'} = 12" eq 12,
32 '"use if" with a true condition, fake pragma');
34 ok( (not defined eval "use if ($v_plus > \$]), strict => 'refs'; \${'f'} = 12"
35 and $@ =~ /while "strict refs" in use/),
36 '"use if" with a true condition and a pragma');
38 # Old version had problems with the module name `open', which is a keyword too
39 # Use 'open' =>, since pre-5.6.0 could interpret differently
40 ok( (eval "use if ($v_plus > \$]), 'open' => IN => ':crlf'; 12" || 0) eq 12,
41 '"use if" with open');