in reply to Re: hashes: testing for the presence of a key
in thread hashes: testing for the presence of a key

Unless @found has pre-existing contents, you can drop the push as well.

my @a = ( 1, 3, 5, 7, 9, 11 ); my @hash{ 1 .. 10 } = 'a' .. 'j'; my @found = map{ exists $hash{$_} ? "$_$hash{$_}" : () } @a; print "@found"; 1a 3c 5e 7g 9i

Examine what is said, not who speaks.
"Efficiency is intelligent laziness." -David Dunham
"When I'm working on a problem, I never think about beauty. I think only how to solve the problem. But when I have finished, if the solution is not beautiful, I know it is wrong." -Richard Buckminster Fuller