my $count = $#array; print "number of elements is " . ++$count . "\n";