Let's say you have an array that contains 4 values.
my @array = qw(value1 value2 value3 value4);
In this example, the $count variable will contain the number of elements in @array.
my $count = @array;
You can print the $count variable;
Which will return 4, meaning there are 4 values in @array.
my $count = @array + 1;
Or like this.
my $count = @array; $count = $count + 1;