[This post notes differences between the fifth and sixth editions.]
There’s not much to write about Perl subroutines that we haven’t written before, but that doesn’t mean that this chapter gets a pass in the update. This is only chapter 4, so it’s still early in the book. Up to this point, we have only covered the basics of Perl scalars and arrays. Once we get into subroutines, we start to talk about scoping variables to a block, and it’s here that we introduce lexical variables.
Once we show of my
, we can tell people about strict
. Still, that’s nothing new. However, since the last time we wrote about strict
, it was something that you had to enable on your own. Perl 5.12 added the feature that you’d get that for free by requiring the version of Perl.
Before Perl 5.12:
use 5.010;
use strict;
Starting with Perl 5.12:
use 5.012; # strict for free
We could tell them how to turn it off, but we still won’t do that until Intermediate Perl.