Essential Skills for Perl 5 Programmers


Every time I explain something in the Modern Perl book under development, I have to change the way I think. I've spent a decade writing Perl 5, testing Perl 5, writing about Perl 5, editing writings about Perl 5, and thinking about how to do all of those. I still learn new things, but I haven't been a novice for a very long time.

Mature projects need the perspective of determined and intelligent novices to help find gaps in tutorials and documentation. It's too easy to assume that the mental model experienced users have is obvious for novices. After all, the design is clearly an effective design for the problems it has to solve.

The problem is two-fold. First, the novice may have very different problems and assumptions when approaching the software. Second, the expert mindset may be implicit: the result of experience developing the software, not approaching the problem fresh.

Any good documentation or tutorial intending to give novices practical experience must explain essential pieces of the model while avoiding too much explanation or gratuitious details. That's difficult to do in technical writing. (That's why most technical writing is passable at best and often atrocious.)

This is a long introduction to explain how I've spent a lot of time thinking about concepts that novices need to understand to take advantage of modern Perl. There are several:

  • Context: how it works, how to identify it, and how to take advantage of it. This includes both void/scalar/list context but also boolean/integer/string/numeric context.
  • Using perldoc: to review syntax and builtins as well as modules
  • Creating, managing, and using modules: including the packaging, testing, building, and deployment systems
  • Installing CPAN modules: especially with tools such as local::lib and, perhaps, a local CPAN mirror
  • Using the Perl 5 analysis tools: not limited to testing modules, Perl::Tidy, Perl::Critic, and B::Deparse

I thought about including "References and data structures", and I may do so. I left out OO on purpose. The same goes for most syntax; those are all learnable. This list tends toward the philosophical on purpose. These are necessary to understand Perl 5 and to take advantage of it (especially for further learning).

If a novice learns these five things, he or she is in good position to use Perl 5 effectively for almost any task. Leave out any one and you've added friction and frustration. Understand them and you can do almost anything in Perl 5.


I'm not sure how true this is for others, but, for me, Moose is what makes Perl 5 "modern," especially relative to the key features and benefits other agile languages. Without discussing Moose, the Modern Perl book may cover issues that are relevant to a part of the Perl community but may not convince those outside of the Perl community that Perl is actually modern.

I also think Moose provides many of advantages in the areas described in the sub-text of the blog title, "elegant, reliable, maintainable, well-tested, and predictable code."

I can imagine two books:

"Modern Perl Foundations" to cover the basics

"Modern Perl" to cover Moose and the like

My 2 cents is that a "Modern Perl" book should include discussion of Moose.

Regarding the novice focus wrt Modern Perl, I first looked into OO because I wanted a simple solution to address the management of a growing app (multiple .pl scripts at the time). After a few experiments, I found that OO was the best approach and started converting my .pl scripts to .pm packages. As soon as a novice starts working on a project of any size, I think OO becomes useful, hence the lead in to Moose.

Because of this, I think it is useful to introduce novices to Moose as a way to organize Perl code in a growing project. As mentioned earlier, Moose is also almost synonymous with Modern Perl to me.

I'll certainly cover Moose in the Modern Perl book, Grokify. It's obviously the best way to write maintainable OO code in Perl 5.

Modern Perl: The Book

cover image for Modern Perl: the book

The best Perl Programmers read Modern Perl: The Book.

sponsored by the How to Make a Smoothie guide



About this Entry

This page contains a single entry by chromatic published on January 20, 2010 6:32 PM.

Types, Invocations, and Designing Bugs Impossible was the previous entry in this blog.

Divine Meaning from Meaningless Numbers is the next entry in this blog.

Find recent content on the main index or look in the archives to find all content.

Powered by the Perl programming language

what is programming?