From: Rafael Garcia-Suarez Date: Mon, 15 Jan 2007 12:37:27 +0000 (+0000) Subject: Move the documentation of the lexical effect of feature.pm to its own X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=9eb27be9a3d66a0e3587505808a86d27c97401e3;p=p5sagit%2Fp5-mst-13.2.git Move the documentation of the lexical effect of feature.pm to its own section thus removing a lot of redundant redundant documentation about it cluttering up the feature documentation. (by Michael G Schwern) p4raw-id: //depot/perl@29818 --- diff --git a/lib/feature.pm b/lib/feature.pm index 4b09e7f..39eaf8e 100644 --- a/lib/feature.pm +++ b/lib/feature.pm @@ -43,31 +43,43 @@ risk. New syntactic constructs can be enabled by C, and will be parsed only when the appropriate feature pragma is in scope. +=head2 Lexical effect + +Like other pragmas (C, for example), features have a lexical +effect. C will only make the feature "foo" available +from that point to the end of the enclosing block. + + { + use feature 'say'; + say "say is available here"; + } + print "But not here.\n"; + =head2 The 'switch' feature C tells the compiler to enable the Perl 6 -given/when construct from here to the end of the enclosing BLOCK. +given/when construct. See L for details. =head2 The '~~' feature C tells the compiler to enable the Perl 6 -smart match C<~~> operator from here to the end of the enclosing BLOCK. +smart match C<~~> operator. See L for details. =head2 The 'say' feature C tells the compiler to enable the Perl 6 -C function from here to the end of the enclosing BLOCK. +C function. See L for details. =head2 the 'err' feature C tells the compiler to enable the C -operator from here to the end of the enclosing BLOCK. +operator. C is a low-precedence variant of the C operator: see C for details. @@ -79,7 +91,7 @@ The 'dor' feature is an alias for the 'err' feature. =head2 the 'state' feature C tells the compiler to enable C -variables from here to the end of the enclosing BLOCK. +variables. See L for details.