in reply to Default Dropdown Value

The first, but with clear self documenting variable names.

 return $inverted{ $values_asc[0] } # default key

Part of the readability problem is that reverse stands for two different functions including an idiomatic trick to invert hashes.

Highlighting that hash inversion was meant can't be wrong...

Cheers Rolf

(addicted to the Perl Programming Language and ☆☆☆☆ :)

update

Talking about performance, the first line is superfluous copying you could already reverse the arguments. :)

Replies are listed 'Best First'.
Re^2: Default Dropdown Value
by choroba (Cardinal) on Oct 17, 2014 at 10:00 UTC
    you could already reverse the arguments
    Where would I get values %h then?
    لսႽ† ᥲᥒ⚪⟊Ⴙᘓᖇ Ꮅᘓᖇ⎱ Ⴙᥲ𝇋ƙᘓᖇ
      @values_asc = sort keys %inverted

      :)

      Cheers Rolf

      (addicted to the Perl Programming Language and ☆☆☆☆ :)