my @new=map { exists $hash{$_} ? $hash{$_} : $_ } @array; #### my @new=map $hash{$_} || $_, @array;