in reply to List context or not?
I think you may be confusing a list with an array. An array does return the number of elements when used in a scalar context. But a list does not.
A list returns the last item in a list. Thus:
And I think your subroutine is returning a list, not an array.$a = (10, 20, 30); # $a = 30 @nums = (10, 20, 30); $a = @array; # $a = 3
buckaduck
In Section
Seekers of Perl Wisdom