Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
PerlMonks  

Re^2: mystery re each + last

by inq123 (Sexton)
on Sep 28, 2005 at 15:49 UTC ( #495807=note: print w/replies, xml ) Need Help??


in reply to Re: mystery re each + last
in thread mystery re each + last

BTW, forgot to mention a derivative from the answer, and a complaint about this 'each' property:

1. Since there's an iterator for each hash, if I had only used 'last' in the inner while loop, then only the inner while loop cannot be re-entered.

2. Actually my script did not leave the iterator in the middle of the hash (it already read the only element in the hash before calling 'last'), it's just that 'each' can only be reset after calling 'each' ONE MORE time AFTER all elements were read. So the documentation above should be modified (because it incorrectly stated "it can be reset by reading all the elements from the hash", but my script did read all elements in the hash!).

Well, just want to be picky, after wasting much time on this error-prone iterator for 'each'. :)

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://495807]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (3)
As of 2020-02-17 03:34 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    What numbers are you going to focus on primarily in 2020?










    Results (70 votes). Check out past polls.

    Notices?