in reply to Re: Numbers aren't averaging correctly
in thread Numbers aren't averaging correctly

Instead of $line =~ s/,//g; to remove commas, I would use a more generalized regex (but on each element, not on each line):
$elem =~ s/[^\d+-e.]//g;

This will remove any char that is not a digit, a +, a -, an 'e' (for numbers like 2e+31), or a point (.).

Or, even better, use Number::Format:

use Number::Format; $elem = unformat_number($elem);

This is especially useful if an array is used instead of the $se# notation. You'd access each one through $se[#] instead, and you could do this:

for (@se) { $_ = $unformat_number($_) }
<-radiant.matrix->
A collection of thoughts and links from the minds of geeks
The Code that can be seen is not the true Code
"In any sufficiently large group of people, most are idiots" - Kaa's Law