Re: Order in which keys are stored in a hash

2011-04-06 Thread Balachandran Sivakumar
On Wed, Apr 6, 2011 at 11:09 PM, Shawn H Corey wrote: >> >>      Thanks a lot for all the replies, links and code snippets. I was >> trying out a few examples from a few websites. And, I was also not >> aware of perldoc until a few hours back. That does seem to be a good >> way to provide help. J

Re: Order in which keys are stored in a hash

2011-04-06 Thread Shlomi Fish
Hi Balachandran, On Wednesday 06 Apr 2011 16:22:44 Balachandran Sivakumar wrote: > Hi, > > I am trying to learn hashes in perl. I created an hash > variable with 4 keys. I tried printing the keys in the hash by:(hash > variable is %machines) > > foreach $key (keys %machines) { > pr

Re: Order in which keys are stored in a hash

2011-04-06 Thread Shawn H Corey
On 11-04-06 10:06 AM, Robert Wohlfarth wrote: On Wed, Apr 6, 2011 at 8:22 AM, Balachandran Sivakumar wrote: I am trying to learn hashes in perl. I created an hash variable with 4 keys. I tried printing the keys in the hash by:(hash variable is %machines) foreach $key (keys %machines)

Re: Order in which keys are stored in a hash

2011-04-06 Thread Robert Wohlfarth
On Wed, Apr 6, 2011 at 8:22 AM, Balachandran Sivakumar wrote: > I am trying to learn hashes in perl. I created an hash > variable with 4 keys. I tried printing the keys in the hash by:(hash > variable is %machines) > > foreach $key (keys %machines) { > print "$key\n"; > } > In the pe

Order in which keys are stored in a hash

2011-04-06 Thread Balachandran Sivakumar
Hi, I am trying to learn hashes in perl. I created an hash variable with 4 keys. I tried printing the keys in the hash by:(hash variable is %machines) foreach $key (keys %machines) { print "$key\n"; } I noticed that the order in which the keys are printed is different from the orde