![]() |
|
We don't bite newbies here... much | |
PerlMonks |
Re: Trouble getting size of list returned from subby ColonelPanic (Friar) |
on Nov 26, 2012 at 10:34 UTC ( [id://1005608]=note: print w/replies, xml ) | Need Help?? |
Here is a solution that potentially uses less memory:
Explanation: All of the other options involve copying the return arguments into an array behind the scenes. This does not, instead creating an array with the same number of elements, but containing the value "1" for each element. This will use less memory if the the sub is returning a list of large items (such as long strings). This would be worth trying if you have problems with high memory usage. (To test this, see the sample code with memory usage test above) When's the last time you used duct tape on a duct? --Larry Wall
In Section
Seekers of Perl Wisdom
|
|