in reply to Trouble getting size of list returned from sub
sub get_size {scalar @_} my $size = get_size(big_list());
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.
|
|---|