in reply to Re^5: grep and dereferencing an array of arrays
in thread grep and dereferencing an array of arrays

Or, maybe more readable for some:
my ($chosen_answer) = grep { $_->[0] eq $answer } @$choices;
لսႽ† ᥲᥒ⚪⟊Ⴙᘓᖇ Ꮅᘓᖇ⎱ Ⴙᥲ𝇋ƙᘓᖇ

Replies are listed 'Best First'.
Re^7: grep and dereferencing an array of arrays
by McA (Priest) on Sep 06, 2013 at 21:12 UTC

    I have to agree that this is more elegant and oakb asked for an elegant solution. Eily proposed almost the same a little earlier.

    Probably I can argue that my solution is more explicit. ;)

    Regards
    McA