diff options
author | Ricardo Signes <rjbs@semiotic.systems> | 2021-04-04 13:22:32 -0400 |
---|---|---|
committer | Ricardo Signes <rjbs@users.noreply.github.com> | 2021-04-04 17:24:27 -0400 |
commit | d15aa6aefc4bcac559a726b31795a77d0a599149 (patch) | |
tree | ddf795e91f576dd4a460188b5d3f55365fb7dd45 /lib | |
parent | 8fa44a45a6d052f95480fa59734072a7868b0512 (diff) | |
download | perl-d15aa6aefc4bcac559a726b31795a77d0a599149.tar.gz |
feature.pl: stop using "switch" as a demo feature!
It is experimental, it would cause warnings, and frankly, I would
like to just inch toward its disappearance.
Diffstat (limited to 'lib')
-rw-r--r-- | lib/feature.pm | 24 |
1 files changed, 13 insertions, 11 deletions
diff --git a/lib/feature.pm b/lib/feature.pm index c57c75da8c..a0bd853ac6 100644 --- a/lib/feature.pm +++ b/lib/feature.pm @@ -5,7 +5,7 @@ package feature; -our $VERSION = '1.63'; +our $VERSION = '1.64'; our %feature = ( fc => 'feature_fc', @@ -85,18 +85,20 @@ feature - Perl pragma to enable new features =head1 SYNOPSIS - use feature qw(say switch); - given ($foo) { - when (1) { say "\$foo == 1" } - when ([2,3]) { say "\$foo == 2 || \$foo == 3" } - when (/^a[bc]d$/) { say "\$foo eq 'abd' || \$foo eq 'acd'" } - when ($_ > 100) { say "\$foo > 100" } - default { say "None of the above" } - } + use feature qw(fc say); + + # Without the "use feature" above, this code would not be able to find + # the built-ins "say" or "fc": + say "The case-folded version of $x is: " . fc $x; + + + # set features to match the :5.10 bundle, which may turn off or on + # multiple features (see below) + use feature ':5.10'; - use feature ':5.10'; # loads all features available in perl 5.10 - use v5.10; # implicitly loads :5.10 feature bundle + # implicitly loads :5.10 feature bundle + use v5.10; =head1 DESCRIPTION |