You're setting your count to 0 after each line read. You want to do it only once per file. So move the my $sumof=0; to just before or after the open statement.
You're also summing up the items *while you're still reading the file*. Finish reading the lines before doing the summing operation.
...roboticus
When your only tool is a hammer, all problems look like your thumb.
In reply to Re: sumof - attempting to sum a column from each file
by roboticus
in thread sumof - attempting to sum a column from each file
by ricky5ive
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |