Document "no feature" (Michael G Schwern)
authorRafael Garcia-Suarez <rgarciasuarez@gmail.com>
Mon, 15 Jan 2007 12:41:28 +0000 (12:41 +0000)
committerRafael Garcia-Suarez <rgarciasuarez@gmail.com>
Mon, 15 Jan 2007 12:41:28 +0000 (12:41 +0000)
p4raw-id: //depot/perl@29819

lib/feature.pm

index 39eaf8e..fde2e6a 100644 (file)
@@ -46,7 +46,7 @@ scope.
 =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 @@ from that point to the end of the enclosing block.
     }
     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