
while (<>) {
  @numbers = split;
  $total = 0;
  foreach $number (@numbers) {
    $total += $number;
    $grand_total += $number;
  }
  print "Total for line $.: $total.\n";
}
print "The grand total of all lines is $grand_total.\n";






