How should I use the “my” keyword in Perl?

后端 未结 3 1595
温柔的废话
温柔的废话 2020-11-29 00:38

I keep seeing the \"my\" keyword in front of variable names in example Perl scripts online but I have no idea what it means. I tried reading the manual pages and other site

3条回答
  •  情书的邮戳
    2020-11-29 01:15

    Private Variables via my() is the primary documentation for my.

    In the array size example you mention, it's not used to find the size of the array. It's used to create a new variable to hold the size of the array.

提交回复
热议问题