laziness, impatience, and hubris | |
PerlMonks |
Re^2: How to pass two arrays to a sub?by Hue-Bond (Priest) |
on Oct 18, 2006 at 11:34 UTC ( [id://579035]=note: print w/replies, xml ) | Need Help?? |
The code above protects your original data against changes in the called subroutine by allocating new anonymous arrays, filling them with the data from the original arrays, and only passing references to the new anonymous arrays to the subroutine. In general, that's a good thing. But it doubles the memory requirement for the arrays so it may not be an option if the arrays are large. --
In Section
Seekers of Perl Wisdom
|
|