in reply to what is the difference between 'my' and 'local'?

my makes a clear and distinct instance of a variable, which is only valid within the current scope (i.e. code block or subroutine)...
Local simply moves the value of the variable to a special place, allows you to do what you want with it in your current scope, and then returns the old value when you leave scope.

of course, that is just a verbal description, I can't think of a really good way to show it in code off the top of my head, though I have seen a few.

                - Ant

  • Comment on Re: what is the difference between 'my' and 'local'?