in reply to invert martix

Take a look at Math::Matrix for solving a set of linear equations. You may also look at PDL for doing more exotic matlab like functions.