Let's take for example the following array. In this example, there are 4 values in the array.
@fruit = qw(banana apple orange grapes);
The following can be used to create a variable that contains the number of elements in the array. In this example, the value of $size will be 4.
my $size = @fruit;