DESCRIPTION

It is usually impossible to add new syntax to Perl without breaking
some existing programs. This pragma provides a way to minimize that
risk. New syntactic constructs can be enabled by usefeature'foo'
,
and will be parsed only when the appropriate feature pragma is in
scope.

Lexical effect

Like other pragmas (usestrict
, for example), features have a lexical
effect. usefeatureqw(foo)
will only make the feature "foo" available
from that point to the end of the enclosing block.

the 'state' feature

FEATURE BUNDLES

It's possible to load a whole slew of features in one go, using
a feature bundle. The name of a feature bundle is prefixed with
a colon, to distinguish it from an actual feature. At present, the
only feature bundle is usefeature":5.10"
which is equivalent
to usefeatureqw(switch say state)
.

Specifying sub-versions such as the 0
in 5.10.0
in feature bundles has
no effect: feature bundles are guaranteed to be the same for all sub-versions.

IMPLICIT LOADING

There are two ways to load the feature
pragma implicitly :

By using the -E
switch on the command-line instead of -e
. It enables
all available features in the main compilation unit (that is, the one-liner.)

By requiring explicitly a minimal Perl version number for your program, with
the useVERSION
construct, and when the version is higher than or equal to
5.10.0. That is,