in reply to Remove key/value pairs from a hash

What doesn't work about it? If I add print keys %hash1; to the end of your code, it prints key5key2key1 What are you expecting?

After Compline,
Zaxo