in reply to Using an array element as a loop iterator
Maybe you should not ignore strict and the other things. You might have got some indication on your mistakes (although I can't check that now, having no environment right now).
[1,2,3] is not an array but a reference to an array. So you may want
ormy $a = [1, 2, 3];
This also does not work:my @a = (1, 2, 3);
Maybe you want something this:foreach $a[1](@b)
but I am really not sure, because the inner array has not been initialized. Finally,foreach @$a[1][@b]
is also probably wrong, since @a is a reference to an array. Please explain what you are really trying to do, I can't really figure out.$a[1]
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Using an array element as a loop iterator
by gurpreetsingh13 (Scribe) on Nov 08, 2013 at 03:52 UTC |