in reply to Using an array element as a loop iterator
The question is a bit ambiguous, so for a wild guess on a mental (side?) track distinct from the prior answers I ask "Are you by any chance trying to do this?"
C:\>perl -e "@a=(1,2,3);@b=(2,4,6,7);for (@a) {print $b[$_];}" 467
Elements of @a used to print portions of @b; namely, $b[1]...$b[3]
Others have noted the problem with instantiating @a by using square brackets. Quotes revised for Windows.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Using an array element as a loop iterator
by GotToBTru (Prior) on Nov 07, 2013 at 20:18 UTC | |
by Kenosis (Priest) on Nov 07, 2013 at 23:36 UTC | |
by ww (Archbishop) on Nov 07, 2013 at 20:30 UTC | |
by GotToBTru (Prior) on Nov 07, 2013 at 20:37 UTC | |
by ww (Archbishop) on Nov 07, 2013 at 21:05 UTC | |
by Laurent_R (Canon) on Nov 07, 2013 at 23:41 UTC |