What does the special variable $#_ mean in Perl?
I encountered this special variable ($#_
) while browsin开发者_StackOverflowg. Tried finding out what it means, but couldn't find any. Please let me know what this special variable mean.
In Perl, you get the index of the last element of @array
with the syntax $#array
. So $#_
is the index of the last element in the array @_
. This is not the same thing as the number of elements in the array (which you get with scalar @array
), because Perl arrays are normally 0-based.
精彩评论