o anonymous brother, I feel that i must bring a certain unsaid morsel of advice to the forefront, for in your particular case it seems exceedingly relevant. it is the case of your indentation and whitespace style. the replies here contain many good examples of effectively using whitespace. specifically, i strongly disagree with your choice of
if ($condition)
{foo(); bar();}
among the many reasons for my distaste, one, is because there is no room to "grow". this is not easily maintainable. something more like
if ( $condition ) {
foo();
#easily read and/or insert & modify code here
bar();
}
is
my typical method
i know this is a sensitive subject, and all are entitled to their own approach, but some constructs are more widely used because they offer advantages to the programmer(s). in the possible case that you have not puch much thought into your use of whitespace and the other superficial aspects of your code* i suggest that you do. it can clear your mind, it may cleanse your soul.
*some superficial aspects of code that come to mind:
variable naming, comments, commonly used task idioms, choice of quote characters
It's not what you look like, when you're doin' what you’re doin'.
It's what you’re doin' when you’re doin' what you look like you’re doin'!
- Charles Wright & the Watts 103rd Street Rhythm Band
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.