On Mon, 7 Aug 2000 15:47:22 -0400, Ted Ashton wrote:

>$x = 2;
>{
>  $x = 1;
>}
>print "$x\n";

>But if lexicals were the default, then the same code would print
>
>2
>
>because it would be equivalent to todays:
>
>my $x = 2;
>{ 
>  my $x = 1;
>}
>print "$x\n";
>
>Would it not?

Wow. Hold it. Some people on this list have written that they want this
to mean:

  my $x = 2;
  { 
     $x = 1;
  }
  print "$x\n";

which is also using lexicals, only, the scope is wide enough to include
all occurences. This makes it almost identical to global variables.

IMO this shows this "default to lexicals" isn't the ultimate solution.

-- 
        Bart.

Reply via email to