for ( @array ) { if ( exists $hash{$_} ) { push @found, $_ . $hash{$_}; } } #### push @found, map { $_ . $hash{$_} } grep { exists $hash{$_} } @array; #### push @found, map { exists $hash{$_} ? $_ . $hash{$_} : () } @array;