This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
perlsub.pod and perlsyn.pod: better organise scoping info for modifiers
authorMartien Verbruggen <mgjv@comdyn.com.au>
Sat, 15 Mar 2003 12:31:47 +0000 (23:31 +1100)
committerRafael Garcia-Suarez <rgarciasuarez@gmail.com>
Fri, 21 Mar 2003 20:43:55 +0000 (20:43 +0000)
Message-Id: <slrnb750k3.j8t.mgjv@martien.heliotrope.home>

p4raw-id: //depot/perl@19043

pod/perlsub.pod
pod/perlsyn.pod

index 918f429..2969341 100644 (file)
@@ -325,14 +325,8 @@ it.  Similarly, in the conditional
 
 the scope of $answer extends from its declaration through the rest
 of that conditional, including any C<elsif> and C<else> clauses, 
-but not beyond it.
-
-B<NOTE:> The behaviour of a C<my> statement modified with a statement
-modifier conditional or loop construct (e.g. C<my $x if ...>) is
-B<undefined>.  The value of the C<my> variable may be C<undef>, any
-previously assigned value, or possibly anything else.  Don't rely on
-it.  Future versions of perl might do something different from the
-version of perl you try it out on.  Here be dragons.
+but not beyond it.  See L<perlsyn/"Simple statements"> for information
+on the scope of variables in statements with modifiers.
 
 The C<foreach> loop defaults to scoping its index variable dynamically
 in the manner of C<local>.  However, if the index variable is
index 0d81b24..16bca2d 100644 (file)
@@ -134,6 +134,13 @@ For C<last>, you have to be more elaborate:
            } while $x++ <= $z;
     }
 
+B<NOTE:> The behaviour of a C<my> statement modified with a statement
+modifier conditional or loop construct (e.g. C<my $x if ...>) is
+B<undefined>.  The value of the C<my> variable may be C<undef>, any
+previously assigned value, or possibly anything else.  Don't rely on
+it.  Future versions of perl might do something different from the
+version of perl you try it out on.  Here be dragons.
+
 =head2 Compound statements
 
 In Perl, a sequence of statements that defines a scope is called a block.