<div class="gmail_quote">On Wed, Jul 28, 2010 at 2:19 PM, Damian Conway <span dir="ltr"><<a href="mailto:damian@conway.org">damian@conway.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
Scott asked:<br>
<div class="im"><br>
> So... the rule is that warnings only happen within the same level of block?<br>
<br>
</div>Yes. The second declaration of a variable name at a given block level generates<br>
a warning. Two declarations in different blocks never has (and never will).<br></blockquote><div><br>It's funny because 'my' will warn, but 'local' is fine:<br><br> perl -we 'use strict;our $f = 10; {my $f = 20; my $f = 30; print $f,"\n"} print $f,"\n"';<br>
perl -we 'use strict;our $f = 10; {local $f = 20; local $f = 30; print $f,"\n"} print $f,"\n"';<br><br>The fact that 'local' doesn't warn makes it seem inconsistent to me. But it could be just the way how I think 'local' works ;p<br>
<br>Alfie<br></div></div>