in reply to printf matrix

Hi,

I think the biggest problem in your solution is that all values are printed in one line. Instead you should start each $key in a new line. That way it would look more like a matrix, and you could improve the rest of your output.

The easiest way to solve this would be to change your third line to

print "\n$key ";
HTH, Rata