I added the foreach-push one before posting because the slice is probably too obscure for most peopleAssuming you are talking about:
it's not just obscure, it doesn't work. @even will get assigned all the fields. You need something like:my (@even, @odd) = @field[ map { $_, $_ + @field / 2 } 0 .. ( @field / 2 ) - 1 ];
my (@even, @odd); (@even[0..(@field/2)-1], @odd[0..(@field/2)-1]) =
In reply to Re^6: split every other value
by ysth
in thread split every other value
by jcpunk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |