# New Ticket Created by karl williamson # Please include the string: [perl #132644] # in the subject line of all future correspondence about this issue. # <URL: https://rt.perl.org/Ticket/Display.html?id=132644 > I am posting this for Dan Book, who is having trouble getting email to perlbug through. The build options and version of perl is immaterial here. 1. When called in scalar context in a while loop, the condition is wrapped implicitly in a 'defined' check, much like with 'readline'. e.g. `while (my $key = each %hash) { ... }` becomes `while (defined(my $key = each %hash)) { ... }`, and `while (each %hash) { ... }` becomes `while (defined($_ = each %hash)) { ... }` (on 5.18+) 2. The iterator is not only shared and reset by calling 'keys' or 'values', but also by other calls to 'each' on the same hash or array, and by accessing the hash in list context (such as for assignment to another structure, or passing to a function) - this last one only applies to hashes, not arrays.Thread Previous | Thread Next