hash keys are stored unsorted. If you have the following hash
%test = ( one => 1,
two => 2,
three => 3);
and print out the hash key/value pairs.
foreach $key (keys %test) {
print "$key is $test{$key}\n";
}
you will find they don't come out in the s
yeah, i new this was tricky.
my hash keys / values have uneven names so i cant use a sort routine directly. thats
why i would like to get the key / values in the same order as they are in the
hashtable file.
whats the name of that hash modules?
:o)
martin
On Tue, Feb 26, 2002 at 10:28:16AM
This maybe...
Tie::LLHash.pm
-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
Sent: 26 February 2002 11:37
To: [EMAIL PROTECTED]
Subject: Re: sort order of hash keys
yeah, i new this was tricky.
my hash keys / values have uneven names so i cant use a sort routine
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.
--
Je
Try the fields module. This sounds like an ideal place to use a pseudo-hash
Thanx,
Smiddy
..
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
On Feb 26, Richard Smith said:
>Try the fields module. This sounds like an ideal place to use a pseudo-hash
EWWW. Pseudo-hashes were a blight on Perl. They slowed things down all
over the place.
--
Jeff "japhy" Pinyan [EMAIL PROTECTED] http://www.pobox.com/~japhy/
RPI Acacia broth
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, February 26, 2002 03:37
To: [EMAIL PROTECTED]
Subject: Re: sort order of hash keys
yeah, i new this was tricky.
my hash keys / values have uneven names so i cant use a sort routine directly. thats
why i would like to get the key / valu