At 9:18 PM +0100 7/11/02, Tim Bunce wrote:
>On Thu, Jul 11, 2002 at 02:29:08PM -0400, Dan Sugalski wrote:
>>  At 7:18 PM +0100 7/11/02, Dave Mitchell wrote:
>>  >On Thu, Jul 11, 2002 at 10:41:20AM -0400, Dan Sugalski wrote:
>>  >>  The place where you'll run into problems in where you have multiple
>>  >>  variables of the same name at the same level, which you can do in
>>  >>  perl 5.
>>  >
>>  >can it?
>>
>>  Yes.
>>
>>  >can you give an example?
>>
>>  [localhost:~] dan% perl
>>  my $foo = 12;
>>  print $foo;
>>  my $foo = "ho";
>>  print $foo;
>>  12ho[localhost:~] dan%
>
>Of course it's a -w warning now:
>
>     "my" variable $foo masks earlier declaration in same scope at - line 3.

Yep, that's warned for as long as I can remember, though that isn't 
all that long, I suppose. Still, it's valid. Wonder how many people 
do that now, completely by accident...

>and I can imagine it becoming a mandatory warning in later versions
>of perl5 (and/or perhaps in future they'll be a way to enable
>warnings relevant to migration to perl6).

I'd hope that it would be one of the things we wouldn't support in 
the perl 5 to perl 6 migration tool. Since it's likely always (or 
darned close to always) an error, I don't think it'll be a big 
problem.
-- 
                                         Dan

--------------------------------------"it's like this"-------------------
Dan Sugalski                          even samurai
[EMAIL PROTECTED]                         have teddy bears and even
                                       teddy bears get drunk

Reply via email to