Quickly, why mix up subroutines and large chunks of code?
May I suggest something like:
I think that this is clearer and easier to understand. It maximises the benefit of using subroutines.
Other than that I agree with the above comments on CGI and strict. CGI is very important from an upkeep point of view - so long as you keep your CGI module up to date you don't have to worry about rewriting your code to match the latest standards. strict is a very useful learning tool.
"The significant problems we face in life can not be solved at the same level of thinking we were at when we created them." -Albert Einstein
Are you posting in the right place? Check out Where do I post X? to know for sure.
Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
<code> <a> <b> <big>
<blockquote> <br /> <dd>
<dl> <dt> <em> <font>
<h1> <h2> <h3> <h4>
<h5> <h6> <hr /> <i>
<li> <nbsp> <ol> <p>
<small> <strike> <strong>
<sub> <sup> <table>
<td> <th> <tr> <tt>
Snippets of code should be wrapped in
<code> tags not
<pre> tags. In fact, <pre>
tags should generally be avoided. If they must
be used, extreme care should be
taken to ensure that their contents do not
have long lines (<70 chars), in order to prevent
horizontal scrolling (and possible janitor
Want more info? How to link or
or How to display code and escape characters
are good places to start.