-
Notifications
You must be signed in to change notification settings - Fork 557
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
The 'each' function documentation is missing some information. #16334
Comments
From @khwilliamsonI am posting this for Dan Book, who is having trouble getting email to The build options and version of perl is immaterial here. 1. When called in scalar context in a while loop, the condition is wrapped e.g. `while (my $key = each %hash) { ... }` becomes 2. The iterator is not only shared and reset by calling 'keys' or |
From @jkeenanOn Fri, 22 Dec 2017 17:39:52 GMT, public@khwilliamson.com wrote:
Can you provide examples where failing to understand these concepts would trip someone up? -- |
The RT System itself - Status changed from 'new' to 'open' |
From @GrinnzOn Fri, Dec 22, 2017 at 4:04 PM, James E Keenan via RT <
For 1, someone might assume that a `while (my $key = each %hash)` loop will For 2, it would not be apparent that the uses I listed would be destructive while (my ($k, $v) = each %hash) { while (my ($k, $v) = each %hash) { -Dan |
From zefram@fysh.orgFixed in commits 1a267a5 and -zefram |
@iabyn - Status changed from 'open' to 'pending release' |
From @khwilliamsonThank you for filing this report. You have helped make Perl better. With the release yesterday of Perl 5.28.0, this and 185 other issues have been Perl 5.28.0 may be downloaded via: If you find that the problem persists, feel free to reopen this ticket. |
@khwilliamson - Status changed from 'pending release' to 'resolved' |
Migrated from rt.perl.org#132644 (status was 'resolved')
Searchable as RT132644$
The text was updated successfully, but these errors were encountered: