There is no order in a hash.
I wouldn't call a hash array as its confusing personally.
If you require order then you can either add another sort to your hash i.e.
make it 3 level with a numerical sort.
Or use a list with a list of hashes.
You can also use Tie::Hash 

-----Original Message-----
From: sivasakthi [mailto:[EMAIL PROTECTED] 
Sent: 25 June 2007 11:36
To: beginners perl
Subject: What is order of retrieving the values from Hash??

Hi Guys...

 I have checked the following file..

#!/usr/bin/perl
use strict;
use warnings;
my ($a,$b);
my %array = ("jan",1,"Feb",2,"Mar",3);
while (($a,$b)= each(%array))
{print $a.$b. "\n";}


the output is like that,

jan1
Mar3
Feb2

What is order of retrieving the values from Hash??  


Thanks,
Siva



This e-mail is from the PA Group.  For more information, see
www.thepagroup.com.

This e-mail may contain confidential information.  Only the addressee is
permitted to read, copy, distribute or otherwise use this email or any
attachments.  If you have received it in error, please contact the sender
immediately.  Any opinion expressed in this e-mail is personal to the sender
and may not reflect the opinion of the PA Group.

Any e-mail reply to this address may be subject to interception or
monitoring for operational reasons or for lawful business practices.





-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/


Reply via email to