I encountered this special variable ($#_
) while browsing. 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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With