<div class="gmail_quote">On Wed, Jul 28, 2010 at 2:19 PM, Damian Conway <span dir="ltr">&lt;<a href="mailto:damian@conway.org">damian@conway.org</a>&gt;</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>
&gt; 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&#39;s funny because &#39;my&#39; will warn, but &#39;local&#39; is fine:<br><br>  perl -we &#39;use strict;our $f = 10; {my $f = 20; my $f = 30; print $f,&quot;\n&quot;} print $f,&quot;\n&quot;&#39;;<br>
  perl -we &#39;use strict;our $f = 10; {local $f = 20; local $f = 30; print $f,&quot;\n&quot;} print $f,&quot;\n&quot;&#39;;<br><br>The fact that &#39;local&#39; doesn&#39;t warn makes it seem inconsistent to me. But it could be just the way how I think &#39;local&#39; works ;p<br>
<br>Alfie<br></div></div>