in reply to Re^6: split an array in two
in thread split an array in two

Apart from the fact that you're still not getting the OP's results, and you now (merely) generate a warning for the 1-element case, you're going through some rather silly gyrations to use @_ as an index instead of $#_. Using @_ as an index is still a bad idea, like using a screwdriver as a hammer. You might eventually get the result you want, but it's needlessly difficult.

Caution: Contents may have been coded under pressure.

Replies are listed 'Best First'.
Re^8: split an array in two
by sh1tn (Priest) on Apr 28, 2005 at 16:21 UTC
    ..needlessly difficult?..

    The Python rule - "There should be one--
    and preferably only one --obvious way to do it."?
    No, I program in Perl.'difficult||easy' - meaningless words.
    Never-the-less - thanks for being polite!