use warnings; use strict; use Acme::Tools qw(avg); my @nums; while (<DATA>) { push @nums, (split)[3]; } print avg(@nums), "\n"; __DATA__ a b c 3 d e f 4 h j k 5
See also:
In reply to Re: average of column
by toolic
in thread average of column
by linseyr
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |