![]() |
|
P is for Practical | |
PerlMonks |
Re: Trouble getting size of list returned from subby ColonelPanic (Friar) |
on Nov 26, 2012 at 14:43 UTC ( [id://1005678]=note: print w/replies, xml ) | Need Help?? |
Yet another solution that uses less memory than a temporary array:
Using the list returned from the sub as the args for another subroutine call is a sneaky way to get an array without actually making a copy. It makes for pretty intuitive code, too. And it probably isn't limited to recent Perl versions, as the map solution is. When's the last time you used duct tape on a duct? --Larry Wall
In Section
Seekers of Perl Wisdom
|
|