phatbasturd has asked for the wisdom of the Perl Monks concerning the following question:
while (@ARGV){ if ($ARGV[0] =~ /add/) { $rtn = add($ARGV[1], /.../); print "The sum is: $rtn"; } elsif ($ARGV[0] =~ /multiply/) { $rtn = multiply($ARGV[1], /.../); print "The product is: $rtn"; } sub add { $sum = $sum + $ARGV; return $sum; } sub multiply { $product = $product * $ARGV; return $product; } }
edited: Mon Dec 16 17:02:01 2002 by jeffa - changed title (was: Help for a beginner)
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
(jeffa) Re: Help with processing command line arguments
by jeffa (Bishop) on Dec 15, 2002 at 18:30 UTC | |
|
Re: Help with processing command line arguments
by diotalevi (Canon) on Dec 15, 2002 at 18:52 UTC | |
by mt2k (Hermit) on Dec 15, 2002 at 23:55 UTC | |
by diotalevi (Canon) on Dec 16, 2002 at 00:35 UTC | |
by theorbtwo (Prior) on Dec 16, 2002 at 23:47 UTC | |
| |
|
Re: Help with processing command line arguments
by jpfarmer (Pilgrim) on Dec 15, 2002 at 18:53 UTC | |
|
Re: Help with processing command line arguments
by ibanix (Hermit) on Dec 16, 2002 at 08:01 UTC |