in reply to First Value in hash
Instead of sorting the keys, which is unnecessary work, you can use List::Util's minstr subroutine.
use List::Util 'minstr'; my $first_key = minstr(keys %in); [download]
lodin