Pre-order Learning Perl, 7th Edition

[Now that the book has been published you don’t need to pre-order it. Just order-order it.]

Learning Perl, 7th Edition is now available for pre-order. thinks they’ll have it by the end of September. Now that you can buy the book, I’ll start posting about what’s different in the new edition. We cover up to Perl v5.24, and I think we snuck in one note about v5.26.

Watch regexes with Regexp::Debugger

Wouldn’t it be great if books had embedded videos? That would make programming textbooks so much easier.

We have to give some hints about how regexes work in the first regex chapter in Learning Perl. It’s hard to describe something like greedy matching and backtracking with only words. It seems like it should be simple to describe, but you are probably like me: you think that because you already understand those concepts. Continue reading “Watch regexes with Regexp::Debugger”

The locale’s thousands separator

Perl can use the thousands separator appropriate for your locale, as well as the appropriate decimal separator. The Number::Format from CPAN can do all sorts of interesting localizations, but POSIX can do it.

I debated offering an example in Learning Perl (7th Edition), but POSIX‘s localeconv function returns a hash reference. And, although I’ve added an appendix covering experimental features, I didn’t want to go through enough Perl to explain slices and postfix dereferencing. Continue reading “The locale’s thousands separator”

The evolution of character class shortcuts

Character class shortcuts used to be easy because ASCII was easy. Either of those were easy if ASCII was what you wanted, but quite limiting otherwise. Perl v5.6 introduced Unicode support and the world started to change.


A good programmer is always trying to eliminate ambiguity. Their code should work the same way everywhere, but character class shortcuts can’t guarantee that anymore. I wrote about these a bit in Know your character classes for The Effective Perler.

Continue reading “The evolution of character class shortcuts”