% perl -wl print( %foo ? "OK" : "KO" ); my @bar = grep $_, @foo{ 1, 2, 3 }; print( %foo ? "OK" : "KO" ); ^D KO OK