@array = keys %hash; foreach $key (@array){ # Access the hash, and do the deed including any hash # key, value deletions. }