in reply to Re: Fun with two-dimensional arrays
in thread Fun with two-dimensional arrays
I guess I obscured my question with too much detail about the problem. I'm asking mostly to satisfy my curiosity.
Without all the
$vscrbaggage, my question is: given an array of arrays (of arbitrary dimensions), how do you hit every element, first visiting the first element in each array, then the second, and so on?
For instance, if you had:
you'd want to visit in the order 1, 4, 7, 2, 5, 8, 3, 6, 9.my $array = [[1, 2, 3], [4, 5, 6], [7, 8, 9]];
Did that make sense?
update: why @ (in scalar context) and $# didn't occur to me when I posted this, I don't know. That said, mapcar is damn cool.
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Re: Re: Fun with two-dimensional arrays
by George_Sherston (Vicar) on Aug 10, 2001 at 04:59 UTC | |
Re: Re: Re: Fun with two-dimensional arrays
by bikeNomad (Priest) on Aug 09, 2001 at 21:23 UTC |