in reply to Re^4: split an array in two
in thread split an array in two
Here's the output:for (0..5) { print map("<@$_>", split_array_in_two(1..$_)), "\n"; }
One-element input is still duplicated. Don't use @_ as an index.<><> <1><1> <1><2> <1><2 3> <1 2><3 4> <1 2><3 4 5>
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^6: split an array in two
by sh1tn (Priest) on Apr 28, 2005 at 15:41 UTC | |
by Roy Johnson (Monsignor) on Apr 28, 2005 at 16:03 UTC | |
by sh1tn (Priest) on Apr 28, 2005 at 16:21 UTC |