in reply to Help with processing command line arguments

At the risk of this being homework, here is some help. If you want to use the contents of @ARGV, don't use a while loop. Just shift off the first arg, which should be the operation to perform. Then you can decide which function to call (and pass that function the remaining arguments inside @ARGV).
use strict; # always! my $op = shift; if ($op =~ /add/) { print "The sum is: ", add(@ARGV), "\n"; } elsif ($op =~ /multiply/) { print "The product is: ", multiply(@ARGV), "\n"; }
Now for the subroutines - $ARGV is not a built-in scalar, you just made it up. :P Try this instead for add:
sub add { my $sum = 0; $sum += $_ for @_; return $sum; } # and if that's too consise - try this one: sub add { my $sum = 0; foreach my $number (@_) { $sum = $sum + $number; } return $sum; }
I'll leave multiply as an exercise. ;)

Oh yeah ... you should take a look at Learning Perl.

jeffa

L-LL-L--L-LL-L--L-LL-L--
-R--R-RR-R--R-RR-R--R-RR
B--B--B--B--B--B--B--B--
H---H---H---H---H---H---
(the triplet paradiddle with high-hat)