# not very imaginative, but hopefully it helps @array = qw(one two three four); # get the number of elements $number_of_elements = $#array +1; print $number_of_elements;