in reply to vector math

I've not used them, but you might check out the Math::MatrixReal module and see if that's what you're looking for. From the documentation:
"Also features many important operations and methods: matrix norm, matrix transposition, matrix inverse, determinant of a matrix, order and numerical condition of a matrix, scalar product of vectors, vector product of vectors, vector length, projection of row and column vectors, a comfortable way for reading in a matrix from a file, the keyboard or your code, and many more."
--Chris