Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses

comment on

( #3333=superdoc: print w/replies, xml ) Need Help??

Dear fellow perlmonks,

I'm looking for a list of well-written Perl modules.

I think of Perl as a very "literary" language. Between Larry Wall's focus on syntactic convenience and fluidity, the principles of TIMTOWTDI, and the plethora of idioms, Perl is written in a wide range of styles unique to individual authors. There is "Baby Perl" of course -- like the "See Spot Run" type books I had as a child. And it wouldn't be hard (and could be an interesting meditation) to make further literary analogies as well: code like Hemingway written in short choppy functions or code like Austen written in florid, overly commented and meandering code. (No offense to Austen fans intended.)

Just as I learned to write in English at least in part by doing a lot of reading, I feel my Perl writing would improve by more exposure to other people's code, particularly, to well-written code. I'm looking for pointers to particularly well written modules (or open-source perl projects) that demonstrate good technique across a range of styles.

In scouring PM and other places, I've not found much that addresses this directly. I'm not looking for a list of "great" modules. Typical answers to this kind of question can be seen on Learning from modules -- which suggests looking at favorite or popular or otherwise "great" modules. I love lists of cool modules like the Advent calendar, too. But cool or heavily used or popular modules are not necessarily well-written or good to learn from -- even though they may be quite functional for day-to-day usage. They may have some quick and dirty hacks inside, may be poorly documented, may be full of "cargo-cult" holdovers, or may be so idiomatic as to be nigh-impenetrable.

Just as I wouldn't point someone to Barnes and Noble and say, "go browse around some bestsellers" to someone looking for a well written book, being told to go look at popular modules on CPAN isn't particularly helpful and is something I could have figured out myself.

Perl code in books about Perl isn't bad but isn't too great either, as it tends to be written simply for a wide audience or tends to be idealized to demonstrate particular techniques or situations. (An exception is probably "Effective Perl Programming" which I'd analogize to Strunk & White "Elements of Style" for improving one's craft).

All of which is to say that I'm looking for thoughtful suggestions for well-written real-world code that is available for review. This could include (but shouldn't be limited to):

  • Other people's code (modules/projects) that you've crawled around the inside of and think is well done
  • Good articles/presentations/books with fuller descriptions of working code
  • Things you've written yourself that you'd self-nominate for closer public scrutiny
  • More broadly, any CPAN authors that you feel generally demonstrate good style and technique

(To go one step further I'd also be interested in hearing the same about test-suites in modules. Now that I'm trying for a more TDD style, I'm pondering if I'm writing too many or too few tests in certain situations and good examples would be helpful.)

Thanks very much,


Code posted by xdg on PerlMonks is public domain. It has no warranties, express or implied. Posted code may not have been tested. Use at your own risk.

Edits: Fixed spellings for Austen and Hemingway -- thanks Cody Pendant. My degree was clearly not in English Lit. :-)

In reply to Looking for examples of well-written modules by xdg

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, 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, 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.
  • Log In?

    What's my password?
    Create A New User
    and the web crawler heard nothing...

    How do I use this? | Other CB clients
    Other Users?
    Others surveying the Monastery: (6)
    As of 2021-01-18 10:35 GMT
    Find Nodes?
      Voting Booth?