in reply to Re: Get hash value with the lowest key
in thread Get hash value with the lowest key
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;
|
|---|