diff options
author | Nicholas Clark <nick@ccl4.org> | 2002-02-19 19:27:42 +0000 |
---|---|---|
committer | Jarkko Hietaniemi <jhi@iki.fi> | 2002-02-20 13:58:16 +0000 |
commit | bc92d8c04127b7dfc16c456beb86f6b7d195458b (patch) | |
tree | 56b7db847de2508329db61a8e8fbfdf433b21ff2 /pod/perlsub.pod | |
parent | a6d5bf86f91571574c0f404a036824df50194368 (diff) | |
download | perl-bc92d8c04127b7dfc16c456beb86f6b7d195458b.tar.gz |
Re: Lexical scoping bug with EXPR for EXPR?
Message-ID: <20020219192740.GF12268@Bagpuss.unfortu.net>
(with modifications)
p4raw-id: //depot/perl@14781
Diffstat (limited to 'pod/perlsub.pod')
-rw-r--r-- | pod/perlsub.pod | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/pod/perlsub.pod b/pod/perlsub.pod index b929c988d6..7933dc2a64 100644 --- a/pod/perlsub.pod +++ b/pod/perlsub.pod @@ -327,12 +327,12 @@ 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:> None of the foregoing text applies to C<if/unless>, -C<while/until> or C<for> modifiers appended to simple statements. Such -modifiers are not control structures and have no effect on scoping. The -use of such modifiers in conjunction with C<my> is best avoided, as it may -have unexpected effects. A future release of Perl may define precise -semantics for constructs such as C<my $foo = 1 if $bar>. +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. The C<foreach> loop defaults to scoping its index variable dynamically in the manner of C<local>. However, if the index variable is |