On 30/10/2009 09:05, Mark Fowler wrote:
> Ideally this would be a utility in List::MoreUtils or suchlike, but
> it's not.
C<part> will do what you want.
use List::MoreUtils 'part'
my $i = 0;
my @part = part { $i++ % 2 } 1 .. 8;
# @part now contains reference to 2 lists, the odd and even elements
It's not very clean, though, or particularly efficient.
A