in reply to Passing reference to subroutine

Actually $#var gives you the subscript of the last item in the list, the scalar value of @var gives you the number of elements in the list. So if you want the number of elements in a list reference, you can get it by:
my $size = scalar @$var;