#!/usr/local/bin/perl use integer; shift; while (<>) { $tot += $_ } print "$tot\n"; #### #!/usr/bin/perl -pl $tot += $_ }{ $_ =+ $tot