develooper Front page | perl.beginners | Postings from February 2002

Re: sort order of hash keys

Thread Previous
From:
Jeff 'japhy' Pinyan
Date:
February 26, 2002 05:35
Subject:
Re: sort order of hash keys
Message ID:
Pine.GSO.4.21.0202260834460.19152-100000@crusoe.crusoe.net
On Feb 26, Martin A. Hansen said:

>i would like to know if theres a smart way to unwind a hashtable so that
>the key / value pairs comes out in the same order as they are in the table.

What "table"?  If you'd like a hash to stay in the order you CREATED it
in, use the Tie::IxHash module.

-- 
Jeff "japhy" Pinyan      japhy@pobox.com      http://www.pobox.com/~japhy/
RPI Acacia brother #734   http://www.perlmonks.org/   http://www.cpan.org/
** Look for "Regular Expressions in Perl" published by Manning, in 2002 **
<stu> what does y/// stand for?  <tenderpuss> why, yansliterate of course.
[  I'm looking for programming work.  If you like my work, let me know.  ]


Thread Previous


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About