in reply to Finding the total number of elements in an array.

In scalar context, the array returns the number of elements.
my @colors = qw/red green blue cyan/; print "I have " . scalar @colors . " colors\n";