For a non-destructive method that leaves the original array intact (we use a modulus flip-flop):
for my $i ( 0 .. $#in ) { $i % 2 ? push @out2, $in[$i] : push @out1, $in[$i]; }
In reply to Re: How can I skip an element in an array whilst reading...
by tachyon
in thread How can I skip an element in an array whilst reading...
by Blanco
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |