note
radiantmatrix
<p>I'm not entirely sure how <code>use Devel::Main 'main'</code> is better syntactic sugar than calling <code>main()</code>... though I object to the <code>main()</code> rather than an executable body in the first place.</p>
<p>It seems like your main concern with just having your 'main' be the body of the script is the risk of conflicting variable names in different scopes causing readability or debugging issues. The easy way around this is to either:<ul>
<li>Abstract your subroutines into one or more modules. Switching files is a pretty good cue that you're in a different scope when you're reading listings.</li>
<p>OR</p>
<li>Use different variable naming conventions for the outer scope; for example, when I have scripts large enough for this to be an issue, all my package-scoped variables begin with a capital letter.</li>
</ul></p>
<p>I suggest that if your scripts are large enough for this sort of confusion to be likely, you're probably best abstracting bits of it away into modules anyhow.</p>
<!--
<p><small><b>Updates:</b><ul type='square'>
<li>date : desc</li>
</ul></small></p>
-->
<div class="pmsig"><div class="pmsig-375088">
<small>
<small><font color='#000000'><</font><font color='#1a1a1a'>–</font><font color='#343434'>r</font><font color='#4e4e4e'>a</font><font color='#686868'>d</font><font color='#828282'>i</font><font color='#9c9c9c'>a</font><font color='#b6b6b6'>n</font><font color='#d0d0d0'>t</font><font color='#eaeaea'>.</font><font color='#d0d0d0'>m</font><font color='#b6b6b6'>a</font><font color='#9c9c9c'>t</font><font color='#828282'>r</font><font color='#686868'>i</font><font color='#4e4e4e'>x</font><font color='#343434'>–</font><font color='#1a1a1a'>></font></small>
<!--<-</small><b>radiant</b>.<b>matrix</b><small>-></small-->
<br><a href='http://radiantmatrix.org/'>Ramblings and references</a>
<br>“A positive attitude may not solve all your problems, but it will annoy enough people to make it worth the effort.” — <em>Herm Albright</em>
<br><em>I haven't found a problem yet that can't be solved by a well-placed [http://en.wikipedia.org/wiki/Trebuchet|trebuchet]</em>
</small>
</div></div>
1038667
1038667