in reply to Hash key counting

The only reason the number of keys won't change is if you have already set that key initially. I would add a line above your for-loop saying %columns = (); or something like that. This way, you guarantee that %columns will be empty when you start your for-loop.

------
We are the carpenters and bricklayers of the Information Age.

Don't go borrowing trouble. For programmers, this means Worry only about what you need to implement.

Please remember that I'm crufty and crochety. All opinions are purely mine and all code is untested, unless otherwise specified.