But would I be able to get to the key as well? As I was waiting for solutions, I came up with the following:
It gets me what I was looking for but is there a better way to do it?my @sorted = sort keys %$href; my $value = $href->{$sorted[0]}; %$href = (); $href->{$sorted[0]} = $value;
In reply to Re^2: Get hash value with the lowest key
by kiat
in thread Get hash value with the lowest key
by kiat
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |