in reply to Passing Any Range of Values to a Sub
If you run "script add 2 1 3 7 5" then your $ARGV[1]..$ARGV[$len] boils down to 2..5 which is the same as 2,3,4,5. You are close. You want 1..$len and use that to get items from @ARGV. That is called an "array slice" and is written @ARGV[1..$len] (note the @ not $).
- tye
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Passing Any Range of Values to a Sub (slice)
by Dru (Hermit) on Jul 02, 2003 at 04:16 UTC |