in reply to Re^2: A brain twister? (how to make 2 lines->1)in thread A brain twister? (how to make 2 lines->1)
How about
while (my ($key, $value) = each %hash) {...} [download]
See each for details. The example is directly from the documentation.
--MidLifeXis