in reply to sorting an array
while (@online) { push @links1, shift @online; push @links2, shift @online; push @links3, shift @online; }
or as per bart's idea of using an array of anonymous arrays (see perlref)
To access the 2nd element (index 1) in the 3rd sub-array (index 2) you would usewhile (@online) { push (@{$links[$_]}, shift @online) for 0..2; }
$var = $links[2]->[1];
--shmem
_($_=" "x(1<<5)."?\n".q·/)Oo. G°\ /
/\_¯/(q /
---------------------------- \__(m.====·.(_("always off the crowd"))."·
");sub _{s./.($e="'Itrs `mnsgdq Gdbj O`qkdq")=~y/"-y/#-z/;$e.e && print}
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: sorting an array
by Anonymous Monk on Apr 07, 2007 at 14:14 UTC | |
by shmem (Chancellor) on Apr 07, 2007 at 19:52 UTC |