Tom Christiansen said:
> >This doesn't fix the problem of:
> >{
> > $somevar = 0;
> > $someVar++; # oops, wrong case!
> >}
> >Forcing 'my' by default allows these errors to be caught.
>
> How so?
>
If the default is to force 'my' to create a lexical, rather than providing a
default lexical scope as Nate was propounding, then I would type:
{
my $somevar;
$somevar = 0;
$someVar++; # oops, wrong case!
}
and perl would say 'Global symbol "$someVar" requires explicit package name
at temp line x.' I'd then immediately see what the problem was. The same
message would not appear if we had a default lexical scope.
I'm sorry if I didn't make this clear first time around.
- RFC: lexical variables made default (revised) J. David Blackstone
- Re: RFC: lexical variables made default (revised) John Tobey
- Re: RFC: lexical variables made default (revi... J. David Blackstone
- Re: RFC: lexical variables made default (revised) Tom Christiansen
- Re: RFC: lexical variables made default (revi... J. David Blackstone
- Re: RFC: lexical variables made default (revised) Nathan Wiger
- Re: RFC: lexical variables made default (revi... Glenn Linderman
- Re: RFC: lexical variables made default (... Nathan Wiger
- Re: RFC: lexical variables made defau... Jeremy Howard
- Re: RFC: lexical variables made ... Tom Christiansen
- Re: RFC: lexical variables m... Jeremy Howard
- Re: RFC: lexical variables made default (revi... Nathan Torkington
- Re: RFC: lexical variables made default (... Nathan Wiger
- Re: RFC: lexical variables made defau... Ariel Scolnicov
- Re: RFC: lexical variables made default (... Damian Conway
- Re: RFC: lexical variables made defau... Nathan Wiger
- Re: RFC: lexical variables made ... Johan Vromans
- Re: RFC: lexical variables m... Nathan Wiger
- Re: RFC: lexical variables m... Tom Christiansen
- Re: RFC: lexical variables made default (revi... J. David Blackstone
- Re: RFC: lexical variables made default (revi... Nick Ing-Simmons
