the best type of perl code is "dumb code", or code that is very straightforward and almost spells out what you're doing. I was wondering, dumb code is good for Java, but what is the best type of perl code?
I believe there are a number of fundamentally "good" programming practices that should be followed in both Perl and Java, indeed in most modern programming languages. I wrote these down in On Coding Standards and Code Reviews. The nearest one to your "dumb code" meme is item 4 in the "General Guidelines" section:
Correctness, simplicity and clarity come first. Avoid unnecessary cleverness.

While I agree your code is easy to follow, it could be improved in terms of testability, abstraction, encapsulation, and DRY. That is, while this style of coding is fine for short, throw away scripts, it does not scale well to larger systems, which are better designed as a set of loosely coupled, highly cohesive modules, each testable in isolation.


In reply to Re: What makes good Perl code? by eyepopslikeamosquito
in thread What makes good Perl code? by slinky773

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • 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:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.