summaryrefslogtreecommitdiff
path: root/lib/feature.pm
diff options
context:
space:
mode:
Diffstat (limited to 'lib/feature.pm')
-rw-r--r--lib/feature.pm24
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