for (keys %hash) { print; } #### for (key %thisisnotintendedasaseriousquestion) { print; } #### for (keys %hash) { print; } for (key %somename) { print; } #### I see this in a book: for (keys %hash) { print; } But it doesn't work in my example, please