#!/usr/bin/perl
#
# eg2: total up numbers on stdin (one per line)
#

my $sum = 0;
while( my $line = <STDIN> ) # for each line from stdin
{
        chomp $line;
        $sum += $line;
}
print "total: $sum\n";

