in reply to Help with Matrix math!

You could use PDL, an efficient math library for Perl. It can do matrix math with ease.