isha has asked for the wisdom of the Perl Monks concerning the following question:
I have a hash of array as follow:
So that
person1 has firstname = name1, lastname =lname1 & city=city1
person2 has firstname =name2, lastname = lname2 & city =city2 and so on....
How can i sort this hash for firstname?
%person = { firstname => ['name1', 'name2', 'name3'], lastname => ['lname1', 'lname2', 'lname3'], city => ['city1','city2','city3'] }
So that
person1 has firstname = name1, lastname =lname1 & city=city1
person2 has firstname =name2, lastname = lname2 & city =city2 and so on....
How can i sort this hash for firstname?
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: How do i sort a hash or array?
by moritz (Cardinal) on Jan 21, 2008 at 13:11 UTC | |
Re: How do i sort a hash or array?
by gam3 (Curate) on Jan 21, 2008 at 13:51 UTC | |
Re: How do i sort a hash or array?
by tuxz0r (Pilgrim) on Jan 21, 2008 at 14:32 UTC | |
Re: How do i sort a hash or array?
by ikegami (Patriarch) on Jan 21, 2008 at 17:52 UTC |
Back to
Seekers of Perl Wisdom