perl

 view release on metacpan or  search on metacpan

regen/feature.pl  view on Meta::CPAN


This feature enables use C<'> (apostrophe) as an alternative to using
C<::> as a separate in package and other global names.

This is enabled by default, but disabled from the 5.42 feature bundle
onwards.  In previous versions it was enabled all the time.

This only disables C<'> in symbols in your source code, the internal
conversion from C<'> to C<::>, including for symbolic references, is
always enabled.

=head2 The 'keyword_any' feature

B<WARNING>: This feature is still experimental and the implementation may
change or be removed in future versions of Perl.  For this reason, Perl will
warn when you use the feature, unless you have explicitly disabled the warning:

    no warnings "experimental::keyword_any";

This feature enables the L<C<any>|perlfunc/any BLOCK LIST> operator keyword.
This allow testing whether any of the values in a list satisfy a given
condition, with short-circuiting behaviour as soon as it finds one.

=head2 The 'keyword_all' feature

B<WARNING>: This feature is still experimental and the implementation may
change or be removed in future versions of Perl.  For this reason, Perl will
warn when you use the feature, unless you have explicitly disabled the warning:

    no warnings "experimental::keyword_all";

This feature enables the L<C<all>|perlfunc/all BLOCK LIST> operator keyword.
This allow testing whether all of the values in a list satisfy a given
condition, with short-circuiting behaviour as soon as it finds one that does
not.

=head1 FEATURE BUNDLES

It's possible to load multiple features together, using
a I<feature bundle>.  The name of a feature bundle is prefixed with
a colon, to distinguish it from an actual feature.

  use feature ":5.10";

The following feature bundles are available:

  bundle    features included
  --------- -----------------
PODTURES
The C<:default> bundle represents the feature set that is enabled before
any C<use feature> or C<no feature> declaration.

Specifying sub-versions such as the C<0> in C<5.14.0> in feature bundles has
no effect.  Feature bundles are guaranteed to be the same for all sub-versions.

  use feature ":5.14.0";    # same as ":5.14"
  use feature ":5.14.1";    # same as ":5.14"

You can also do:

  use feature ":all";

or

  no feature ":all";

but the first may enable features in a later version of Perl that
change the meaning of your code, and the second may disable mechanisms
that are part of Perl's current behavior that have been turned into
features, just as C<indirect> and C<bareword_filehandles> were.

=head1 IMPLICIT LOADING

Instead of loading feature bundles by name, it is easier to let Perl do
implicit loading of a feature bundle for you.

There are two ways to load the C<feature> pragma implicitly:

=over 4

=item *

By using the C<-E> switch on the Perl command-line instead of C<-e>.
That will enable the feature bundle for that version of Perl in the
main compilation unit (that is, the one-liner that follows C<-E>).

=item *

By explicitly requiring a minimum Perl version number for your program, with
the C<use VERSION> construct.  That is,

    use v5.36.0;

will do an implicit

    no feature ':all';
    use feature ':5.36';

and so on.  Note how the trailing sub-version
is automatically stripped from the
version.

But to avoid portability warnings (see L<perlfunc/use>), you may prefer:

    use 5.036;

with the same effect.

If the required version is older than Perl 5.10, the ":default" feature
bundle is automatically loaded instead.

Unlike C<use feature ":5.12">, saying C<use v5.12> (or any higher version)
also does the equivalent of C<use strict>; see L<perlfunc/use> for details.

=back

=head1 CHECKING FEATURES

C<feature> provides some simple APIs to check which features are enabled.

These functions cannot be imported and must be called by their fully



( run in 1.822 second using v1.01-cache-2.11-cpan-ceb78f64989 )