in reply to Re^5: split every other value
in thread split every other value
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]) =
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^7: split every other value
by Aristotle (Chancellor) on Aug 07, 2004 at 01:05 UTC |