Nick Ing-Simmons wrote:
> 
> 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

Plus, are you willing to guarantee that no reassignment ($foo =
$unnamed_foo) is every forgotten?
-- 
Matthew O. Persico
    
"If you were supposed to understand it,
we wouldn't call it code." - FedEx

____________NetZero Free Internet Access and Email_________
Download Now     http://www.netzero.net/download/index.html
Request a CDROM  1-800-333-3633
___________________________________________________________

Reply via email to