What is the difference between my and local in Perl?
The short answer is that my marks a variable as private in a lexical scope, and local marks a variable as private in a dynamic scope. It’s easier to understand my, since that creates a local variable in the usual sense. There is a new variable created and it’s accessible only within the enclosing lexical … Read more