#!/usr/bin/perl -w

($sum, $n) = sumvars(0, 1, 2, 3, 4);
($sum2, $n2) = sumvars(5, 6, 7);
print "The first list had $n elements and the sum was: $sum\n";
print "The second list had $n2 elements and the sum was: $sum2\n";

sub sumvars {
   my $sum = 0;
   my $n = @_;
   foreach $arg ( @_ ) {
      $sum += $arg;
   }
   return ($sum, $n);
}

