You might want to take a look at Math::Matrix. In addition to multiplying matrices, it does transposition and concatenation of matrices, and will solve the system represented by an augmented matrix.
And part of understanding how the wheel works is to make sure you are familiar with the existing art. We are trying to point out the similar solutions, so that the reinvention of the wheel can benefit all, not just make busy work for one person.