summaryrefslogtreecommitdiff
path: root/regen
diff options
context:
space:
mode:
authorRicardo Signes <rjbs@semiotic.systems>2021-04-04 13:22:32 -0400
committerRicardo Signes <rjbs@users.noreply.github.com>2021-04-04 17:24:27 -0400
commitd15aa6aefc4bcac559a726b31795a77d0a599149 (patch)
treeddf795e91f576dd4a460188b5d3f55365fb7dd45 /regen
parent8fa44a45a6d052f95480fa59734072a7868b0512 (diff)
downloadperl-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 'regen')
-rwxr-xr-xregen/feature.pl24
1 files changed, 13 insertions, 11 deletions
diff --git a/regen/feature.pl b/regen/feature.pl
index 2db99ef957..a7522aa037 100755
--- a/regen/feature.pl
+++ b/regen/feature.pl
@@ -478,7 +478,7 @@ read_only_bottom_close_and_rename($h);
__END__
package feature;
-our $VERSION = '1.63';
+our $VERSION = '1.64';
FEATURES
@@ -491,18 +491,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