<br><div class="gmail_quote">On Mon, Jan 19, 2009 at 1:46 PM, Dan Linder <span dir="ltr">&lt;<a href="mailto:dan@linder.org">dan@linder.org</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Just to follow-up on my previous e-mail, here are my results and a test case.<br><br>I added the &quot;no warnings qw(uninitialized)&quot; jusst before my line 57, but left out the &quot;use warnings qw(uninitialized)&quot; as Jay suggested and it worked like a charm.<br>

<br>In another section of code, I had similar warnings but that code called a few other subroutines.&nbsp; I setup this code to test if the &quot;no use warnings&quot; would carry over to the subroutine:<br><br>dan:/tmp$ cat d30.pl<br>

#!/usr/bin/perl<br>use warnings;<br>sub myfunc {<br>&nbsp; $f1 = 123;<div class="Ih2E3d"><br>}<br>$x = 10;<br>for (1..1) {<br>&nbsp; no warnings;<br>&nbsp; $y = 10;<br></div>&nbsp; $funcreturn = myfunc();<br>}<br>$z = 10;<br><br>dan:/tmp$ ./d30.pl<br>
Name &quot;main::f1&quot; used only once: possible typo at ./d30.pl line 6.<br>
Name &quot;main::z&quot; used only once: possible typo at ./d30.pl line 15.<br>Name &quot;main::x&quot; used only once: possible typo at ./d30.pl line 9.<br>dan@dglaptop:PerlTests$<br><br clear="all">The &quot;no warnings&quot; does not carry out of the current block of code into the subroutine (I got the &quot;main::f1 used only once&quot;).<br>

<br>Thanks for the input everyone,</blockquote><div><br></div></div>$f1 is not in the C&lt;for&gt; block. It is globally defined. ( wont compile with C&lt;use strict;&gt; )<br><br>use C&lt;my&gt; for variable declarations.<br>
<br>#!/usr/bin/perl<br>use warnings;<br>sub myfunc {<br>&nbsp; my $f1 = 123;<br><br>}<br>my $x = 10;<br>for (1..1) {<br>&nbsp; no warnings;<br>&nbsp; $y = 10;<br>&nbsp; $funcreturn = myfunc();<br>}<br>my $z = 10;<br><br>Gives you a clean run.<br>
<br clear="all"><br>-- <br>Ted Katseres<br> &nbsp; &nbsp; &nbsp;||=O=||<br>