Hi!
I have a hash that looks something like this:
[tt]
key1: 4
key2: 1
key3: 19
key4: 8
key5: 14
[/tt]
Then I am going to foreach this hash but I would like it in reverse number order using the values 4, 1, 19, 8, 14.
Something like this:
So the output from such a foreach would be:
[tt]
key3: 19
key5: 14
key4: 8
key1: 4
key2: 1
[/tt]
Thanks in advance
Masali
I have a hash that looks something like this:
[tt]
key1: 4
key2: 1
key3: 19
key4: 8
key5: 14
[/tt]
Then I am going to foreach this hash but I would like it in reverse number order using the values 4, 1, 19, 8, 14.
Something like this:
Code:
foreach my $key(keys %Sets) #some sorting gizmo...
{
print "$key: $Sets{$key}\n";
}
[tt]
key3: 19
key5: 14
key4: 8
key1: 4
key2: 1
[/tt]
Thanks in advance
Masali