![]() |
|
No such thing as a small change | |
PerlMonks |
Re^3: Trouble getting size of list returned from subby ColonelPanic (Friar) |
on Nov 26, 2012 at 09:57 UTC ( [id://1005604]=note: print w/replies, xml ) | Need Help?? |
This does, indeed, create a copy of the array. In fact, in my testing it used more memory than just creating an array variable. Surprisingly (to me, anyway) the temporary variable method was the most memory-efficient. However, any option you are going to use incurs a lot of overhead that could be avoided if the sub were written to handle this. Here is a script I used to play around with memory usage: If you are not on Windows, see this Stackoverflow question, whence I got the memory usage sub, and which also gives some non-Windows options. When's the last time you used duct tape on a duct? --Larry Wall
In Section
Seekers of Perl Wisdom
|
|