in reply to Can't localize lexical variable $var at...
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).
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Can't localize lexical variable $var at...
by shotgunefx (Parson) on Jun 10, 2002 at 06:46 UTC | |
by Elian (Parson) on Jun 10, 2002 at 07:18 UTC |