Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

Re: Why Doesn't each() DWIM?

by hardburn (Abbot)
on May 27, 2004 at 20:54 UTC ( #357053=note: print w/replies, xml ) Need Help??


in reply to Why Doesn't each() DWIM?

It is explicilty documented that hashes never, never, never have any meaningful order to them. So your "what you would expect" output is never going to be guarenteed to happen.

Now, for having each be localized . . . maybe. It might cause problems with tied hashes. I'll leave it to someone more familer with the internals.

----
send money to your kernel via the boot loader.. This and more wisdom available from Markov Hardburn.

Replies are listed 'Best First'.
Re: Re: Why Doesn't each() DWIM?
by enoch (Chaplain) on May 27, 2004 at 21:12 UTC
    hashes never, never, never have any meaningful order to them.
    Right, right. I am not asking that a hash have order; rather, I just want each call to each to iterate over the entire hash; rather than having to make an explicit reset call (my $x = keys %hash) between calls to each.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others taking refuge in the Monastery: (5)
As of 2023-11-29 18:41 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?