foreach $k (keys %hash){ delete ($hash{$k}) unless exists $end{$k}; }
You were using $_ as the key to %end. You have not set $_ in the code you posted so it is unlikely to have a value that you want. This should clear the error.
In reply to Re: Delete keys in hash if they exist in another hash
by inman
in thread Delete keys in hash if they exist in another hash
by tgolf4fun
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |