Check implicit loading of features with use VERSION. __END__ # Standard feature bundle use feature ":5.10"; say "Hello", "world"; EXPECT Helloworld ######## # VERSION requirement, dotted notation use 5.9.5; say "Hello", "world"; EXPECT Helloworld ######## # VERSION requirement, v-dotted notation use v5.9.5; say "Hello", "world"; EXPECT Helloworld ######## # VERSION requirement, decimal notation use 5.009005; say "Helloworld"; EXPECT Helloworld ######## # VERSION requirement, doesn't load anything with require require 5.9.5; print "<".$INC{"feature.pm"}.">\n"; EXPECT <> ######## # VERSION requirement in eval {} eval { use 5.9.5; say "Hello", "world"; } EXPECT Helloworld ######## # VERSION requirement in eval "" eval q{ use 5.9.5; say "Hello", "world"; } EXPECT Helloworld ######## # VERSION requirement in BEGIN BEGIN { use 5.9.5; say "Hello", "world"; } EXPECT Helloworld ######## # no implicit features with 'no' eval "no " . ($]+1); print $@; EXPECT ######## # lower version after higher version sub evalbytes { print "evalbytes sub\n" } sub say { print "say sub\n" } use 5.015; evalbytes "say 'yes'"; use 5.014; evalbytes; use 5; say "no" EXPECT Downgrading a use VERSION declaration to below v5.11 is deprecated, and will become fatal in Perl 5.40 at - line 8. yes evalbytes sub say sub ######## # Implicit unicode_string feature use v5.14; my $sharp_s = chr utf8::unicode_to_native(0xdf); print 'ss' =~ /$sharp_s/i ? "ok\n" : "nok\n"; use v5.8.8; print 'ss' =~ /$sharp_s/i ? "ok\n" : "nok\n"; EXPECT Downgrading a use VERSION declaration to below v5.11 is deprecated, and will become fatal in Perl 5.40 at - line 5. ok nok ######## # Implicit unicode_eval feature use v5.15; require '../../t/charset_tools.pl'; my $long_s = byte_utf8a_to_utf8n("\xc5\xbf"); print eval "use utf8; q|$long_s|" eq $long_s ? "ok\n" : "nok\n"; use v5.8.8; print eval "use utf8; q|$long_s|" eq "\x{17f}" ? "ok\n" : "nok\n"; EXPECT Downgrading a use VERSION declaration to below v5.11 is deprecated, and will become fatal in Perl 5.40 at - line 6. ok ok