There is no such thing as too much documentation, no matter how redundant it may be.
Whew! Obviously you haven't seen the code I have.
use warnings; # turn warnings on
use CGI; # use Stein's CGI.pm for parsing params
my $q = new CGI; # create the CGI.pm instance
# get the customer's name (in the name parameter)
# place in in variable $customer_name
my $customer_name = $q->param("name")
# if the customer's name is "Bobby"
# print "Hi Bobby"
if ($customer_name eq "Bobby") {
print "Hi Bobby\n";
} else { # if not, print "You're not Bobby"
print "You're not Bobby\n";
}
Get the point? This completely distracts from the code and takes way more time on the part of the programmer.
As for subs, I say one comment directly above them. Anymore and the sub is too long and should be broken into multiple subs.
-
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.
|