Change 29819 by [EMAIL PROTECTED] on 2007/01/15 12:41:28
Document "no feature" (Michael G Schwern)
Affected files ...
... //depot/perl/lib/feature.pm#12 edit
Differences ...
==== //depot/perl/lib/feature.pm#12 (text) ====
Index: perl/lib/feature.pm
--- perl/lib/feature.pm#11~29818~ 2007-01-15 04:37:27.000000000 -0800
+++ perl/lib/feature.pm 2007-01-15 04:41:28.000000000 -0800
@@ -46,7 +46,7 @@
=head2 Lexical effect
Like other pragmas (C<use strict>, for example), features have a lexical
-effect. C<use feature qw(foo)> will only make the feature "foo" available
+effect. C<use feature qw(foo)> will only make the feature "foo" available
from that point to the end of the enclosing block.
{
@@ -55,6 +55,21 @@
}
print "But not here.\n";
+=head2 C<no feature>
+
+Features can also be turned off by using C<no feature "foo">. This too
+has lexical effect.
+
+ use feature 'say';
+ say "say is available here";
+ {
+ no feature 'say';
+ print "But not here.\n";
+ }
+ say "Yet it is here.";
+
+C<no feature> with no features specified will turn off all features.
+
=head2 The 'switch' feature
C<use feature 'switch'> tells the compiler to enable the Perl 6
End of Patch.