Syntax::Construct—explicitly declare the syntactic constructs your program uses.
You want to
use say
in your program.
use feature qw{ say };
use feature ':5.10'; # or use v5.10;
-E
.
feature
is
lexically scoped.
feature
doesn't
work for pre-5.10 Perls.
You want to use the defined-or operator
(//
).
use v5.10; # defined-or //
Search pattern not terminated at ... Scalar found where operator expected at ...
But...
(?|...)
isn't documented in any perldelta.
It is available starting from Perl 5.10.0.
Well, branch reset is an exception. Who would ever use it, anyway?
$string =~ /:/p; my ($before, $after) = ( ${^PREMATCH}, ${^POSTMATCH} );
... Perl 5.10.0 introduces...
#!/usr/bin/perl use warnings; use strict; use Syntax::Construct qw( // ?| );
Benefits for
5.24 will be the first Perl version to remove a non-feature.
my $h = { a => 12, b => 14 }; print keys $h;
Experimental keys on scalar is now forbidden at ...
5.24 will be the first Perl version to remove a non-feature.
my $h = { a => 12, b => 14 }; print keys $h;
Experimental keys on scalar is now forbidden at ...
But after prepending
use Syntax::Construct qw{ auto-deref };
The error message in 5.23.3 is different:
Faking version 5.024 to test removals. auto-deref removed in 5.024 at ... BEGIN failed--compilation aborted at ...
What's in a name? that which we call a rose
By any other name would smell as sweet
length-undef
, computed-labels
)
feature
Very simple.
We store all the non-features in a hash with
their corresponding minimal Perl versions. In
the import
method, we
just require the maximal
version in a block eval.
Each construct is
See GitHub.
YAPC::EU | Granada 2015 |