Great Perl Code

schwern on 2010-01-11T22:59:39

I was in a bar the other day talking with somebody about Perl. He asked, "what is some great Perl code I could read?" He was looking for a non-trivial amount of production Perl 5 code that elegantly solves a problem, and is beautiful to read.

I'm couldn't answer that. The code I see is either beautiful to read but fairly boring in what it does OR is an elegant solution but is terrifying to read (for example, autodie). I'm a biased observer, I work mostly with the plumbing so I see mostly the scary stuff that implements the elegant solutions.

What code would you show a non-Perl programmer read that is both beautiful and interesting?


Shamelessly self-promotional

mugwumpjism on 2010-01-12T00:28:07

Date::Holidays::NZ, MooseX::Timestamp. Crypt::Password, by a colleague.

Maybe Net::MythTV by Acme?

hrm...

Alias on 2010-01-12T00:30:37

Alas, most of my great code is great because it's so trivial for that job. :(

Dist::Zilla

melo on 2010-01-12T07:58:48

I like Dist::Zilla.

The plugin system is very nice.

AppConfig; Games::Pentominos

dami on 2010-01-12T14:17:14

AppConfig by Andy Wardley is widely used, nontrivial in what it does (reading complex configuration data from various sources), and beautiful to read.

Games::Pentominos by myself is not very useful, but also nontrivial in what it does (solving a paving puzzle by recursive trial and error), and I shamelessly think it is quite nice to read, displaying a number of Perl features (regexes, functional grep/map, compilation on the fly, etc.).