What do you mean 'kills'? For example, does it peg the CPU? Start swapping? What?

Depending on that answer, there may be options to help that. Or maybe not. For example, if you're swapping, DBM::Deep may help - but, in many ways, that's just swapping one part of the hard drive for another (no pun intended). How about not gluing them up until you're about to use them? e.g.,

for (my $i = 0; $i < scalar @arr1; ++$i) { my @garr = (@$arr1[$i], @$arr2[$i]); # do main processing on @garr here. }
That way, you only have the combination of one row at a time in memory, discarding when done. Or, perhaps you can destroy the original arrays as you go?
for (my $i = 0; $i < scalar @arr1; ++$i) { @{$garr[$i]} = ( shift(@$arr1[$i]), shift(@$arr2[$i]) ); }
At the end of this, @arr1 and @arr2 should be empty.

If you're pegging the CPU, your actual handling of @garr will peg it, too, so there's really not much I can think of for doing.


In reply to Re: Expanding Two demensional arrays by Tanktalus
in thread Expanding Two demensional arrays by pigal

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.