You should improve style if you want someone to go over your
code.
In long subroutines, name your formal parameters
by using my ($nm1, $nm2) = @_ to
avoid dealing explicitely with @_ within the
subroutine. Best code is self-commenting code by savvy use
of variables names.
Incidentally, another possible style
is to name actual parameters as well. This is especially
interesting if some actual parameters may be missing
sub add ( nm1 => $val1, $nm2 => $val1 }
sub add { local %_ = ( @_ );
$_{nm1} + $_{nm2}
}
If you follow my first advice, this one will be unecessary
in this particular case. But here it is anyway, you
should use slices:
[\&db_clk, $_[1], $_[2], $_[3], $_[4] ]
could be rewritten
[ \&db_clk, @_[1..4] ]
.
--
stefp -- check out TeXmacs
wiki
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.