P.6. Changes from the Previous Edition
The text is updated for the latest version, Perl 5.14, and some of the code only works with that version. We note in the text when we are talking about a Perl 5.14 feature, and we mark those code sections with a special use statement that ensures you’re using the right version:
use 5.014; # this script requires Perl 5.14 or greater
If you don’t see that use 5.014 in a code example (or a similar statement with a different version), it should work all the way back to Perl 5.8. To see which version of Perl you have, try the -v command-line switch: $ perl -v
Here’s some of the new features from Perl 5.14 that we cover, and where appropriate, we still show you the old ways of doing the same thing:* We include Unicode examples and features where appropriate. If you haven’t started playing with Unicode, we include a primer in Appendix C. You have to bite the bullet sometime, so it might as well be now. You’ll see Unicode throughout the book, most notably in the chapters on Scalars (Chapter 2), Input/Output (Chapter 5), and Sorting (Chapter 14).
* There is more information in the regular expression chapters, covering the new features from Perl 5.14 to deal with Unicode case-folding. The regular expression operators have new /a, /u, and /l switches. We now cover matching by Unicode properties with the \p{} and \P{} regular expression features.
* Perl 5.14 adds a nondestructive substitution operator (Chapter 9), which turns out to be really handy.
* Smart matching and given-when has mutated a bit since their introduction in Perl 5.10, so we update Chapter 15 to cover the new rules.
* We updated and expanded Perl Modules (Chapter 11) to include the latest news, including the zero-conf cpanm tool. We add some more module examples as well.
* Some of the items previously in Appendix B, the advanced-but-not-demonstrated features, move into the main text. Notably, that includes the fat arrow => moving into Hashes (Chapter 6) and splice moving into Lists and Arrays (Chapter 3).