"A man's maturity -- consists in having found again the
seriousness one had as a child, at play." --Nietzsche
| [reply] [d/l] |
$avg /= @data; basically means same as $avg = $avg / @data. You're dividing $avg by the number of elements in @data and storing the result back in $avg. The tricky part is that computers have this nasty habbit of freaking out on divisions by zero (because technically you can't divide by zero).
A fix would include something like :
$avg = scalar(@data) ? $avg /= @data : 0;
Beatnik
... Quidquid perl dictum sit, altum viditur. | [reply] [d/l] [select] |