The handful of basic Perl concepts

I’ve now given the second Effective Perl Programming class, this time a two-day master class at YAPC::NA 2010 in Columbus. The common comment during the class seemed to be “You just blew my mind again”. I’m also giving this talk in a one day format at YAPC::EU in Pisa on Aug 7

Most of the class goes back to the basics and re-learning the handful of underlying rules in Perl. These are the things that we don’t get bogged down with in Learning Perl, where we want to get as much Perl in front of people as soon as possible so they can start writing Perl programs (no matter how ugly they might look). Effective Perl Programming, however, takes that to another level as Perlers come back to think about the subtle things that they ignored while they were trying to get the big picture. Learning any language is a spiralling effort to big up the big concepts then coming back around to refine them, over and over.

I’ve started to make a list of the handful of things that Perlers need to understand, and none of it has to do with tricky syntax. Many people never pick up these concepts, so they come up with complicated models to explain why things happen. Instead, the Perler just needs to understand:

  • Data and variables are different things (e.g. lists and arrays)
  • Operators matter more than data for deciding what happens
  • Context is important (strings and numbers; scalar, list, and void)
  • Run-time versus compile time, and when things happen despite their location in the code