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. » Read more…

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. » Read more…

DOS pattern matching, in Perl

Perl’s file globbing uses the FreeBSD-style globbing, but it works mostly everywhere since Perl handles it internally through the File::Glob module. I’m working on the “Directory Operations” chapter for Learning Perl, 7th edition, where we cover glob. I’m trying to make the book more Windows friendly so I’ve been considering how this stuff translates.

I ran across Raymond Chen’s “How did wildcards work in MS-DOS?”. He lays out the steps for turning what we think of as a pattern (such as “*.txt”) into the CP/M-style pattern that MS-DOS used. He shows how to convert the glob pattern to primitive pattern. » Read more…

Looking for Learning Perl reviewers

[I’ve found enough reviewers and am not accepting more. If you’ve been a reviewer for a past Learning Perl, however, you can volunteer again. If you’re interested in doing this sort of work, pay attention to any of my blogs since I’m likely to start revising another book when I finish this one.]

I’ve got Learning Perl, 7th Edition building on O’Reilly’s Atlas system. That means I can start showing it to other people for comments and reviews. If you think that you’d like to be one of those people, send me an email (the first step being the sort who can find my email address). » Read more…

We’re starting Learning Perl, 7th edition

The holiday season tends to find me writing Perl books. This time it’s the next edition of Learning Perl, last published for Perl v5.14. This time we’re targeting v5.24, and there are lots of exciting new features that we want to tell the new Perl users.


"7"


We can’t make promises at the beginning of the book, but here’s the rough idea so far:

  • Goodbye, smart match. We gave it a chapter, but now it’s experimental .
  • But, subroutine signatures! People are going to love those.
  • So, an appendix on experimental features. Or maybe a chapter. Mostly on how to enable them.
  • the /r modifier for s///
  • Removing most of the stuff that Perl has discarded without abandoning people using older versions.
  • Key-value slices, and slices, and splice.
  • The double diamond operator <<>>.
  • New Unicode regex stuff

I’ve done this too many times to promise a release date either, but late summer wouldn’t be a bad guess. When I get the current version into something editable and fixed up, I’ll start putting out review versions somehow. I don’t know how that will work yet.