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.

Reply via email to