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


in reply to Strange behavior with List::Util qw{first} on perl >= 5.20

Hmmmm... Perl v5.20:

$ perl -MList::Util=first -le 'print first {lc eq "abc"} keys %{{ABC=>"ABC"}}' abc $ perl -MList::Util=first -le 'print first {uc eq "ABC"} keys %{{ABC=>"ABC"}}' ABC $ perl -MList::Util=first -le 'print first {/abc/i} keys %{{ABC=>"ABC"}}' ABC $ perl -MList::Util=first -le 'print first {lc eq "abc"} values %{{ABC=>"ABC"}}' ABC $ perl -MList::Util=first -le 'print first {lc eq "abc"} "ABC"' ABC $ perl -MList::Util=first -le 'print first {lc eq "abc"} values @{["ABC"]}' ABC

On v5.10 they all (except for the last one) give "ABC". The inverse case, first {uc eq "ABC"} keys %{{abc=>"abc"}}, also gives the "unexpected" result "ABC". Smells like a bug... could this be rt://96343?