perl -lne '$sum+=$_; END{print $sum}'
and
perl -le '$sum+=$_ while <>; print $sum'
don't slurp either. <> is an iterator (in scalar context).
In reply to Re^2: adding a column of integers
by ikegami
in thread adding a column of integers
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |