Just a few general style comments. First, get into the habit of starting your programs with:
use strict;
at least until you understand when not to use it. I have not seen Lemay's book, but I trust it has a good explanation of use strict -- if not, discard it immediately. Second, drop the awful Perl-4 style:
&initarg;
function calling syntax and use the modern style:
initarg();
Third, lexicals are good. So replace:
foreach $i (@_) {
with:
foreach my $i (@_) {
Again, I trust Lemay describes why lexicals should generally be preferred to globals.
Like the others, I recommend switching to
learning perl. See
merlyn's blog entry for an interesting example of a Perl beginner learning Perl in public from merlyn's excellent introductory work.
-
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>
<u> <ul>
-
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
intervention).
-
Want more info? How to link
or How to display code and escape characters
are good places to start.
|