in reply to matrix multiplication

Not exacly an answer to your question, but there is a module Math::Matrix that has a multiply function (for 2 matrices) see here.