for (@array){ delete $hash1{$_} if exists $hash1{$_}; }