New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Inconsistent & nonintuitive initialization of private "my" variables in a scoped code block #11285
Comments
From perl@g.zazu.comCreated by perl@g.zazu.comThere seems to be a bug (or at least mis-documented non-intuitive handling) ####################### use strict; print "Run 1:\n"; print "\nRun 2:\n"; ######################## Run 1: Run 2: ######################## Note that $var has a previous value in Run 2 on the second pass into the loop. ######################## foreach (1 .. 2) { sub try ######################## I later discovered that the perl behavior is even more inconsistent than ######################## use strict; foreach my $i (-3 .. 3) { ######################## var: (i: -3) ######################## Notice that the first three iterations above exhibit the same behavior as noted Perl Info
|
From @iabynOn Thu, Apr 28, 2011 at 03:24:30PM -0700, perl@g.zazu.com wrote:
To quote from perlsyn: B<NOTE:> The behaviour of a C<my> statement modified with a statement -- |
The RT System itself - Status changed from 'new' to 'open' |
@iabyn - Status changed from 'open' to 'rejected' |
Migrated from rt.perl.org#89514 (status was 'rejected')
Searchable as RT89514$
The text was updated successfully, but these errors were encountered: