I've ceased using &quot;no strict 'refs'&quot;, and instead use the excellent Symbol module to manipulate the symbol table.<br><br>Instead of:<br><br>use strict;<br>{<br>&nbsp; no strict 'refs';<br>&nbsp; my ($pkg, $subname) = qw( Foo bar );
<br>&nbsp; *{&quot;${pkg}::${subname}&quot;} = sub { print &quot;Howdy!\n&quot; };<br>}<br><br>I use:<br><br>use strict;<br>use Symbol;<br>my ($pkg, $subname) = qw( Foo bar );<br>*{Symbol::qualify_to_ref( $subname, $pkg )} = sub { print &quot;Howdy!\n&quot; };
<br><br><div><span class="gmail_quote">On 10/19/06, <b class="gmail_sendername">Mike Stok</b> &lt;<a href="mailto:mike@stok.co.uk">mike@stok.co.uk</a>&gt; wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div style=""><div><span class="e" id="q_10e601ef7120f676_1"><br><div><div>On 19-Oct-06, at 1:14 AM, Bill Raty wrote:</div><br><blockquote type="cite">You have warnings enabled 'the -w switch on shebang'.<br><br>With warnings enabled perl will output a message whenever it detects an undefined value in a join or string interpolation.&nbsp; To demonstrate:
<br><br>&nbsp; use warnings; <br>&nbsp; use strict;<br><br>&nbsp; my $empty = undef;<br>&nbsp; print &quot;Perl will warn about this $empty string.\n&quot;;<br><br>I rarely use warnings in production code.&nbsp; It is better to locally scope warnings in code sections where you are certain you must always have data that is not null. 
<br><br> </blockquote><br></div></span></div><div>I usually work the other way around, using warnings everywhere, and then using no warnings as tightly scoped as possible to mark where I know uninitialized variables and perl's treatment of them are OK
</div><div><br></div><div>use strict;</div><div>use warnings;</div><div><br></div><div>my $empty = undef;</div><div>{</div><div>&nbsp;&nbsp; &nbsp;no warnings 'uninitialized';</div><div>&nbsp; &nbsp; print &quot;Perl will not warn about this $empty string.\n&quot;;
</div><div>}</div><div><br></div><div>(Let's not notice that $empty is initialized in this code, so the warning is misleading.)</div><div><br></div><div>The same goes for using &quot;no strict 'refs';&quot;&nbsp; around code where I might be using strings to manipulate the symbol table.
</div><div><br></div><div>The lexical relaxation reminds me later that I was doing something &quot;odd&quot; in this chunk of code.</div><div><br></div><div><br></div><div>Mike</div><br><div> <span style="border-collapse: separate; border-spacing: 0px; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;">
<span style="border-collapse: separate; border-spacing: 0px; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;">
<span style="border-collapse: separate; border-spacing: 0px; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;">
<span style="border-collapse: separate; border-spacing: 0px; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;">
<div style="margin: 0px;">--&nbsp;</div><div style="margin: 0px;"><br></div><div style="margin: 0px;">Mike Stok &lt;<a href="mailto:mike@stok.co.uk" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">mike@stok.co.uk
</a>&gt;</div><div style="margin: 0px;"><a href="http://www.stok.ca/%7Emike/" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">http://www.stok.ca/~mike/</a></div><div style="margin: 0px;"><br></div><div style="margin: 0px;">
The &quot;`Stok' disclaimers&quot; apply.</div><div style="margin: 0px;"><br></div><div><br></div><br></span></span></span></span> </div><br></div>
</blockquote></div><br><br clear="all"><br>-- <br>For a list of all the ways technology has failed to improve the quality of life, please press three.<br>&nbsp;&nbsp;- Alice Kahn