$#array is the index of the last element of @array. Yes, you can use it as one end of the range of indexes as shown. However, that is hardly ever the Perl way. Generally if you want to run through the elements in an array you would:
for my $element (@array) {
print "$element\n\n";
}
# or using the default variable
for (@array) {
print "$_\n\n";
}
# or using for as a statement modifier
print "$element\n\n" for @array;
If you really need to index through the array then the Perlish way is to use a range (but see Flipin good, or a total flop?):
for (0..$#array) {
print "$array[$_]\n\n"
}
DWIM is Perl's answer to Gödel