in reply to Re: adding a column of integers
in thread adding a column of integers
The END block is executed after everything else. You can also use a corresponding BEGIN block before anything else runs, and there are others (CHECK and INIT, having to do with compile time) for fancy stuff.perl -lne '$sum+=$_; END{print $sum}'
|
---|