This is partially for hysterical raisins, as global variables and local predated lexicals by quite a bit in perl's history. Local is a hackish way to implement lexical scope without lexical variables.
There's also little reason to use local with a lexical--since local overrides a variable until the end of the scope, you might as well either overwrite the lexical (if it's in the scope the lexical was declared) or my a new version of the lexical (if it's in an inner scope from the declaration).
In reply to Re: Can't localize lexical variable $var at...
by Elian
in thread Can't localize lexical variable $var at...
by Courage
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |