> I'm seeking an equivalent without splice - so that @list remains unaffected. Any suggestions...?

If @list doesn't have millions of entries, I'd just copy to a new @tmp array before prior to using your solution.

But in the sense of TIMTOWTDI and with the power of autovivification ... :)

(demo in debugger)

DB<260> @a= "a" .. "h" DB<261> @b=(); $i=0; $C=3 DB<262> push @{ $b[ $i++/$C ] } , $_ for @a DB<263> x @b 0 ARRAY(0x3d7e3b0) 0 'a' 1 'b' 2 'c' 1 ARRAY(0x3d81440) 0 'd' 1 'e' 2 'f' 2 ARRAY(0x3d8e7f8) 0 'g' 1 'h' DB<264> x @a 0 'a' 1 'b' 2 'c' 3 'd' 4 'e' 5 'f' 6 'g' 7 'h' DB<265>

HTH :)

NB: you haven't been clear about your row $R requirement.

update

it's a poor man's solution for hippo's part() solution in Re: List into two-dimensional array, but since List::MoreUtils isn't core and List::Util doesn't offer it ...

Cheers Rolf
(addicted to the Perl Programming Language :)
Wikisyntax for the Monastery


In reply to Re: List into two-dimensional array by LanX
in thread List into two-dimensional array by Anonymous Monk

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.