开发者

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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜