Is it possible to assign an entire 1-D array to a row in a 2-D array without looping and without using references? Example(What I don't want to do):
while (my @kp_src_t_row=$sth->fetchrow_array()) { for ($column=0; $column<@kp_src_t_row; $column++) { $currentarray[$kp_num][$column] = $kp_src_t_row[$column]; } $kp_num++; }
This is what I want to do in theory but don't have a clue if it can be done:
while (my @kp_src_t_row=$sth->fetchrow_array()) { $currentarray[$kp_num]= @kp_src_t_row $kp_num++; }
Such that in the end @currentarray would contain many rows of the data retrieved from the fetch into @kp_src_t_row. Thanks.

In reply to Assigning an Array to a Multidimensional Array by keithbas

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.