in reply to vector math

Perhaps Math::VecStat would suit your needs (I happened upon it while looking for a module for calculating primes).

It's description: "This package procides some basic statistics on numerical vectors. All the subroutines can take a copy of the vector, or, preferably for efficiency, a reference to the vector to be operated on.

max(@vector), max(\@vector)

return the maximum value of given values or vector. In an array context returns the value and the index in the array where it occurs.

min(@vector), min(\@vector)

return the minimum value of given values or vector, In an array context returns the value and the index in the array where it occurs.

maxabs(@vector), maxabs(\@vector)

return the maximum value of absolute of the given values or vector. In an array context returns the value and the index in the array where it occurs.

minabs(@vector), minabs(\@vector)

return the minimum value of the absolute of the given values or vector, In an array context returns the value and the index in the array where it occurs.

sum($v1,$v2,...), sum(@vector), sum(\@vector)

return the sum of the given values or vector average($v1,$v2,..), average(@vector), average(\@vector)

return the average of the given values or vector."

redmist