in reply to (proposed)Scoping tutorial
> Since local only works on globals, you can't use it on a my variable...It's good to realize that this restriction is entirely arbitrary. In principle, there's nothing wrong with the idea of giving a my variable a new value temporarily, and arranging for its old value to return automatically, later on, which is what local does. Someone (I think Chip) even contributed a patch to Perl to enable this. But Larry thought it might be confusing, and rejected it.
|
|---|