foreach my $k (@mips) { $hash{$k} = 999 unless exists $hash{$k}; }