1 Check implicit loading of features with use VERSION.
4 # Standard feature bundle
10 # VERSION requirement, dotted notation
16 # VERSION requirement, v-dotted notation
22 # VERSION requirement, decimal notation
28 # VERSION requirement, doesn't load anything with require
30 print "<".$INC{"feature.pm"}.">\n";
34 # VERSION requirement in eval {}
42 # VERSION requirement in eval ""
50 # VERSION requirement in BEGIN
58 # no implicit features with 'no'
59 eval "no " . ($]+1); print $@;
62 # lower version after higher version
63 sub evalbytes { print "evalbytes sub\n" }
64 sub say { print "say sub\n" }
66 evalbytes "say 'yes'";
77 # SKIP ? not defined DynaLoader::boot_DynaLoader
79 no warnings 'deprecated';
81 print qw[a b c][2], "\n";
83 print qw[a b c][2], "\n";
89 # SKIP ? not defined DynaLoader::boot_DynaLoader
90 use feature 'say'; # make sure it is loaded and modifies %^H; we are test-
91 use v5.8.8; # ing to make sure it does not disable $[
92 no warnings 'deprecated';
94 print qw[a b c][2], "\n";
98 # $[ under < 5.10 after use v5.15
99 # SKIP ? not defined DynaLoader::boot_DynaLoader
102 no warnings 'deprecated';
104 print qw[a b c][2], "\n";
108 # Implicit unicode_string feature
110 my $sharp_s = chr utf8::unicode_to_native(0xdf);
111 print 'ss' =~ /$sharp_s/i ? "ok\n" : "nok\n";
113 print 'ss' =~ /$sharp_s/i ? "ok\n" : "nok\n";
118 # Implicit unicode_eval feature
120 require '../../t/charset_tools.pl';
121 my $long_s = byte_utf8a_to_utf8n("\xc5\xbf");
122 print eval "use utf8; q|$long_s|" eq $long_s ? "ok\n" : "nok\n";
124 print eval "use utf8; q|$long_s|" eq "\x{17f}" ? "ok\n" : "nok\n";