in reply to reading matrix and printing

You might want to check out the transpose feature of Math::Matrix. It may seem like overkill now, but when your matrices get large enough doing it manually is a pain.



Code is (almost) always untested.
http://www.justicepoetic.net/