S
scadav
I am new to Perl and this problem is baffling me. I undestand how to
print out all the items in a hash and sort by the keys:
foreach $item (sort keys(%hash)) {
print "$item: $hash{$item} \n";
}
but how do you do the reverse of this?...print out all of the items
but sort on the values?
any help would be appreciated.
print out all the items in a hash and sort by the keys:
foreach $item (sort keys(%hash)) {
print "$item: $hash{$item} \n";
}
but how do you do the reverse of this?...print out all of the items
but sort on the values?
any help would be appreciated.