http://www.perlmonks.org?node_id=63954


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:
$a = (10, 20, 30); # $a = 30 @nums = (10, 20, 30); $a = @array; # $a = 3
And I think your subroutine is returning a list, not an array.

buckaduck