in reply to Remove key/value pairs from a hash

Greetings: The following code worked for me:
#! /usr/bin/perl %hash1=("key1"=>"value1","key2"=>"value2", "key3"=>"value3", "key4"=>" value4", "key5"=>"value5"); @array=(key3, key4); foreach (@array){ delete($hash1{"$_"}); } while (($key,$value)= each (%hash1)){ print "$key =$value\n"};
by producing
key5 =value5 key2 =value2 key1 =value1