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
FIRST doesn't see lexicals from surrounding block #3146
Comments
From @coke23:54 < [Coke]> r: for 1..10 { my $a = 3; FIRST { say $a} } I would expect that to output "3". -- |
From @pmichaudOn Sat May 25 21:13:26 2013, coke wrote:
Since the FIRST block is invoked before the assignment/initialization, For example: > for 1..5 { my $a; FIRST { $a = 3 }; say $a } Thus the FIRST block sees the correct lexical $a... it's just executing Pm |
The RT System itself - Status changed from 'new' to 'open' |
From @cokeOn Sat May 25 22:32:15 2013, pmichaud wrote:
Spec agress with you: "at loop initialization time, before any ENTER" I expected it to mean "the FIRST time a block is executed". My workaround was to use a lexical to track if it was the first time through the loop or not; Sadly, Rejecting ticket. -- |
@coke - Status changed from 'open' to 'rejected' |
From @masakcoke (>):
<masak> [Coke]: doesn't START do exactly what you wanted from FIRST? |
Migrated from rt.perl.org#118179 (status was 'rejected')
Searchable as RT118179$
The text was updated successfully, but these errors were encountered: