#!/usr/bin/perl -w

@arr = ( 0, 1, 2, 3, 4 );
sumvars(@arr);

sumvars(1, 2, 3, 4);

sub sumvars {
   $sum = 0;
   foreach $arg ( @_ ) {
      $sum += $arg;
   }
   print "The sum is: $sum\n";
}
