To get the number of items in an array, you can evaluate the array as scalar context.
my @array = ("Apple", "Orange", "Tomato");
my $count = @array;
print $count;
Also scalar method can be used. This way seems more simple.
print scalar(@array);