Buddha Buck <[EMAIL PROTECTED]> writes:
>I haven't looked at the internals for local, but isn't:
>
>{
> local $foo;
>
> ...
>}
>
>effectively syntactic sugar for:
>
>{
> my $unnamed_foo = $foo; # $unnamed_foo not accessible
>
> ...
>
> $foo = $unnamed_foo;
>}
>
>Is there something in the behavior of local I'm missing?
There certainly is - that functions _called_ in the scope of the
local see the $unnamed_foo as the value of $foo too.
While hard to get ones brain round at first is is amazingly useful
on occasion.
--
Nick Ing-Simmons
- Typeglobs, filehandles, asterisks Peter Scott
- Re: Typeglobs, filehandles, asterisks skud
- Re: Typeglobs, filehandles, asterisks Tom Christiansen
- Re: Typeglobs, filehandles, asterisks Ted Ashton
- RE: Typeglobs, filehandles, asterisks Garrett Goebel
- RE: Typeglobs, filehandles, asterisks Dan Sugalski
- Re: Typeglobs, filehandles, asterisks Hildo Biersma
- Re: Typeglobs, filehandles, asterisks Dan Sugalski
- Re: Typeglobs, filehandles, asteris... Buddha Buck
- Re: Typeglobs, filehandles, ast... Sam Tregar
- Re: Typeglobs, filehandles, ast... Nick Ing-Simmons
- Re: Typeglobs, filehandles,... Matthew Persico
- Re: Typeglobs, filehandles, asteris... Chaim Frenkel
- Re: Typeglobs, filehandles, ast... Dan Sugalski
- Re: Typeglobs, filehandles,... Chaim Frenkel
- multiline comments Michael Mathews
- Re: multiline comments Tom Christiansen
- Re: multiline comments Tom Christiansen
- Re: multiline comments Michael Mathews
- Re: multiline comments Tom Christiansen
- Re: multiline comments Michael Mathews
