You're trying to be too complicated. Instead of taking a hash and removing what shouldn't be there, why don't you just create a new hash by adding what should be there. Something along the lines of:
my %hash2;
for (@ary) {
$hash2{$_} = $hash1{$_} if exists $hash1{$_};
}
undef %hash1;