This fix the illegal division of 0 and now it gives me the result of 0#!/usr/bin/perl @nums = (); for(0..$#nums) { $sum += $_; } $size = $#nums; $average = $sum / $size; print "$average";
In reply to Re^4: Help with arrays
by perlguru22
in thread Help with arrays
by perlguru22
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |