Beefy Boxes and Bandwidth Generously Provided by pair Networks
Come for the quick hacks, stay for the epiphanies.
 
PerlMonks  

Re^2: Pick any key from a very large hash

by FloydATC (Deacon)
on Jul 11, 2009 at 22:25 UTC ( [id://779271]=note: print w/replies, xml ) Need Help??


in reply to Re: Pick any key from a very large hash
in thread Pick any key from a very large hash

Yes, by using keys or values... exactly what I don't want :-)

-- Time flies when you don't know what you're doing

Replies are listed 'Best First'.
Re^3: Pick any key from a very large hash
by hobbs (Monk) on Jul 12, 2009 at 11:25 UTC
    "In particular, calling keys() in void context resets the iterator with no other overhead."
      "In particular, calling keys() in void context resets the iterator with no other overhead."
      Unfortunately, that's on the keys entry, and not on the each entry, which it seems to be more relevant to. If I'm using keys without each, why do I care if keys resets the each iterator?

      Granted, a little digging would have found this. And perhaps the OP's avoidance of keys caused the miss.

      -QM
      --
      Quantum Mechanics: The dreams stuff is made of

Re^3: Pick any key from a very large hash
by jwkrahn (Abbot) on Jul 11, 2009 at 22:27 UTC

    Or: "it can be reset by reading all the elements from the hash"

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others perusing the Monastery: (5)
As of 2024-04-16 13:30 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found