in reply to Expanding Two demensional arrays

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.

Replies are listed 'Best First'.
Re^2: Expanding Two demensional arrays
by pigal (Novice) on Jan 30, 2007 at 11:48 UTC
    - CPU: 100% and timeout for tea :-)
    - I have no idea how to check swapping on Linux RH9, but HDD works hard so - maybe there are also problems.
    - Your first advice is great but I've no power to force it (but I've tried and who knows maybe it will be accepted).
    - I can not destroy source arrays

    THX