http://www.perlmonks.org?node_id=1103261


in reply to Re^2: Lookup closest hash key
in thread Lookup closest hash key

my ($answer) creates list context, so the [0] at the end is not needed: it is a list assignment, the first element on the left gets the first element on the right. With the index at the end, you can drop the parentheses on the left, as it is a scalar assignment:
my $answer = ( sort { abs( $a - $dist ) <=> abs( $b - $dist ) } keys % +$href )[0];
لսႽ ᥲᥒ⚪⟊Ⴙᘓᖇ Ꮅᘓᖇ⎱ Ⴙᥲ𝇋ƙᘓᖇ