10

I've looked into the source code of DBIx::Class recently and found that I don't understand a thing (though I mastered a couple tricks while trying to).

So my question is: which CPAN modules are a must read for someone who wants to learn, and in what order?

friedo
  • 65,762
  • 16
  • 114
  • 184
Dallaylaen
  • 5,268
  • 20
  • 34

4 Answers4

10

If I were doing the same I’d probably start with the ::Tiny space. I’d expect it to be less distracting—fewer edge cases cluttering things—and more idiomatic—terseness lends itself to Perl idiom—in general.

Then I’d attack the medium–large nodes from this excellent document—Map of the CPAN’s authors (large PDF). Update: Web version. Zoom into the bigger nodes then search on search.cpan.org for them. The largest nodes sometimes represent old-school and while exceptional code exists in the old school, not a lot of good teaching examples do (so I say). Authors like Miyagawa, Kennedy, and Kogman come to mind immediately as worth reviewing. There are plenty of others. Basically any module you see recommended here often, look up the author and poke around his or her other packages, as it were.

Ashley
  • 4,307
  • 2
  • 19
  • 28
6

I learned quite a bit (tie-ing, platform independent filesystem access, etc) by reading the code for File::chdir. It is also a very handy module to use in your scripts, I use it all the time.

I would also add to bvr's list: read the source for modules that you use frequently, since you are already familiar with their expected behavior, you can more clearly see what is being done to achieve that result.

Joel Berger
  • 20,180
  • 5
  • 49
  • 104
3

The question is what you want to learn, but it is certainly good idea to study various modules, because you learn to read other people code and learn various tricks. Some random recommendations I can think of

  • start with smaller modules with clear interface you know and are interested in
  • once you feel familiar with organization of modules and basics, try something larger
  • try rather newer modules
  • look into test suite and into examples
  • if you don't understand specific piece, try to make reduced example a play with it

It is hard to recommend something specific, but I liked my recent look into Web::Scraper module.

bvr
  • 9,687
  • 22
  • 28
1

If you're fluent in perl - if don't perldoc ;) - , sugest learn the packages Task::Kensho or Modern::Perl.

These packages do cover comprehensive in culture Perl, since tests until hacks, passing by crawling, modules to developers, e-mail, dates, modern oriented obejct in Perl.

Participe of discussion lists, read the history of list, irc. Perl have many tricks, the community always responds with enthusiasm =)

dolmen
  • 8,126
  • 5
  • 40
  • 42