perl

 view release on metacpan or  search on metacpan

t/lib/feature/bundle  view on Meta::CPAN

EXPECT
201
########
# more specific: 5.10.0 maps to 5.10
use feature ":5.10.0";
say "Hello", "world";
EXPECT
Helloworld
########
# as does 5.10.1
use feature ":5.10.1";
say "Hello", "world";
EXPECT
Helloworld
########
# as does 5.10.99
use feature ":5.10.99";
say "Hello", "world";
EXPECT
Helloworld
########
# 5.9.5 also supported
use feature ":5.9.5";
say "Hello", "world";
EXPECT
Helloworld
########
# 5.9 not supported
use feature ":5.9";
EXPECT
OPTIONS regex
^Feature bundle "5.9" is not supported by Perl \d+\.\d+\.\d+ at - line \d+
########
# 5.9.4 not supported
use feature ":5.9.4";
EXPECT
OPTIONS regex
^Feature bundle "5.9.4" is not supported by Perl \d+\.\d+\.\d+ at - line \d+
########
# 5.8.8 not supported
use feature ":5.8.8";
EXPECT
OPTIONS regex
^Feature bundle "5.8.8" is not supported by Perl \d+\.\d+\.\d+ at - line \d+
########
# :default
BEGIN { *say = *state = *given = sub { print "custom sub\n" }; }
use feature ":default";
say "yes";
state my $foo;
given a => chance;
EXPECT
custom sub
custom sub
custom sub
########
# :default and $[
# SKIP ? not defined DynaLoader::boot_DynaLoader
no feature;
use feature ":default";
$[ = 0;
$[ = 1;
EXPECT
Assigning non-zero to $[ is no longer possible at - line 5.
########
# "no feature"
use feature ':5.16'; # turns array_base off
no feature; # resets to :default, thus would turn array_base on, if it still existed
$[ = 0;
$[ = 1;
EXPECT
Assigning non-zero to $[ is no longer possible at - line 5.
########
# "no feature 'all"
no feature ':all'; # turns array_base (and everything else) off
$[ = 1;
EXPECT
Assigning non-zero to $[ is no longer possible at - line 3.
########
# NAME $^H accidentally enabling all features
# HINT_FEATURE_MASK | HINT_LOCALIZE_HH
eval 'BEGIN { $^H |= 0x3c020000 } $_ = evalbytes 12345';
print $_||$@;
EXPECT
Number found where operator expected (Do you need to predeclare "evalbytes"?) at (eval 1) line 1, near "evalbytes 12345"
syntax error at (eval 1) line 1, near "evalbytes 12345"
Execution of (eval 1) aborted due to compilation errors.



( run in 1.035 second using v1.01-cache-2.11-cpan-5b529ec07f3 )