On Thu, Feb 15, 2001 at 11:23:10AM -0800, Nathan Wiger wrote:
>
> I agree with this statement. Perhaps someone who was around during the
> initial 'my' discussions can shed some light on why it binds so tightly.
> I have observed you can do something like this:
>
> my $OUTER = '';
>
> if ( $some_value ) {
> # 'my' only on the first one
> (my $inner, $OUTER) = split;
>
> # more code that uses $inner ...
> }
>
> if ( $OUTER ) {
> # $inner not here, but that's fine...
> }
>
> But I have never found a situation where this is so useful to justify
> the other problems it creates. However, there may well be true technical
> reasons why "my $x, $y, $z" does not do what many think it should.
As I wrote elsewhere, other reasons not to change the behaviour of my:
GetOptions (foo => \my $foo,
bar => \my $bar);
tie my $shoe => $tring;
Abigail
- Re: Closures and default lexical-scope for subs David Grove
- Re: Closures and default lexical-scope for subs Nathan Wiger
- Re: Closures and default lexical-scope for subs Branden
- Re: Closures and default lexical-scope for subs John Porter
- Re: Closures and default lexical-scope for subs Randal L. Schwartz
- Re: Closures and default lexical-scope for subs Branden
- Re: Closures and default lexical-scope for subs John Porter
- Re: Closures and default lexical-scope for subs abigail
- Re: Closures and default lexical-scope for subs abigail
- Re: Closures and default lexical-scope for subs Nicholas Clark
- Re: Closures and default lexical-scope for subs Edward Peschko
- Re: Closures and default lexical-scope for subs Jonathan Scott Duff
- Re: Closures and default lexical-scope for subs Edward Peschko
- Re: Closures and default lexical-scope for subs Peter Scott
- Re: Closures and default lexical-scope for subs Nathan Wiger
- Re: Closures and default lexical-scope for subs Edward Peschko
- Re: Closures and default lexical-scope for subs Peter Scott
- Re: Closures and default lexical-scope for subs Edward Peschko
- Re: Closures and default lexical-scope for subs abigail
