What exactly does \'use 5.014\' enable?
Please, someone copy&paste here, because i was not able find it in any perldoc. (maybe i\'m blind). In the \'perldoc feat
Besides what raj correctly said about the error messages you'd receive if using use 5.014
with an older version of Perl, you can find a list of features enabled reading the source code of feature. The relevant part is near the top:
my %feature_bundle = (
"5.10" => [qw(switch say state)],
"5.11" => [qw(switch say state unicode_strings)],
"5.12" => [qw(switch say state unicode_strings)],
"5.13" => [qw(switch say state unicode_strings)],
"5.14" => [qw(switch say state unicode_strings)],
);
The strict bit part is buried somewhat deeper in the code for the interpreter itself. If you look into pp_ctl.c for tag v5.11.0:
/* If a version >= 5.11.0 is requested, strictures are on by default! */
if (PL_compcv && vcmp(sv, sv_2mortal(upg_version(newSVnv(5.011000), FALSE))) >= 0) {
PL_hints |= (HINT_STRICT_REFS | HINT_STRICT_SUBS | HINT_STRICT_VARS);
}
In newer Perls (starting with 5.10 I think) use 5.x
does an implicit use feature ':5.x'
Reading through the perldeltas for 5.12 & 5.14, I see a unicode-related feature added in 5.12, but it appears nothing new was added in 5.14.
The use x.x.x
pragma does turn on some features, and it's easy enough to test this:
#!/usr/bin/env perl
use warnings;
use 5.14.0;
say "hello world!"
Runs great; outputs "hello world!".
#!/usr/bin/env perl
use warnings;
# use 5.14.0;
say "hello world!"
Flaming death; outputs this error message:
Unquoted string "say" may clash with future reserved word at foo line 5.
String found where operator expected at foo line 5, near "say "hello world!""
(Do you need to predeclare say?)
syntax error at foo line 5, near "say "hello world!""
Execution of foo aborted due to compilation errors.
I'm not, however, 100% sure which features are turned on as of 5.14.0. I believe that you get say
, state
, switch
, unicode_strings
and strict
.