in reply to How to find number of elements of an array from array reference
length is for getting string lengths. To get the number of elements, simply use the array in scalar context:
my $elems = @$array_ref; [download]