I didn’t mention Sub::Install in the “Dynamic Subroutines” (or maybe the Symbol Table chapter. It was worth a mention (but only that). I show readers how to define subroutines in other packages (or even the current one, I guess) by assigning to a type glob: Continue reading “Sub::Install has a nice interface”
Download most Mastering Perl programs
The Mastering Perl Downloads page now has the named programs I’ve extracted from the book sources. This comprises most of the programs that you can run to do something, rather than all the code segments—many of which are fragments.
I wrote the book as Pod, then converted to DocBook. Despite all the advice we give people about parsing XML properly, I did the thing we tend to tell people not to do: Continue reading “Download most Mastering Perl programs”
Naming anonymous subroutines
In the “Dynamic Subroutines” chapter, I considered adding the undocumented __ANON__
trick to give anonymous subroutines names. ysth described this in Permonks in 2003 in Named anonymous subs and later showed up in Perl Hacks #57. Although it’s undocumented, several modules use the trick. Continue reading “Naming anonymous subroutines”
Mastering Perl Kindle screen shots
Catalin Ciurea (CATALIN on CPAN) sent in some pictures to show what Mastering Perl looks like on a Kindle, although he doesn’t specify which device it is. It’s one of the less sophisticated ones, but I’m surprised that it looks as good as it does. I knew the body text would be find, but it looks like the code comes out nicely too. Curiously, the book is measured in time, and it looks like he’s taking longer and longer to get through it as he progresses! Continue reading “Mastering Perl Kindle screen shots”
Mastering Perl Kindle version
You can read Mastering Perl on your Kindle now. The print edition should be in the warehouses in a couple of weeks.
I don’t have a Kindle so I don’t know how the book looks in it. I don’t have much hope for the older Kindles, but what about the new Fires? Send me a screenshot if you’d like me to see what you see!
The Mastering Perl Module Index
Mastering Perl Second Edition has a module index, which is something I first tried in Programming Perl 4th Edition. Here’s just the index from the last review I just turned in (which means the book should be available in about a month). Continue reading “The Mastering Perl Module Index”
Presentation: Parsing JSON with a single Perl regex
I’m giving a presentation from Mastering Perl while I’m in Houston next week.
- Thursday, October 17, 7pm
- cPanel, Inc. (3131 W. Alabama St.)
- Hosted by Houston Perl mongers
Perl v5.10 added several features that take (ir)regular expressions to a new level. With grammars and recursion, a single regex can now process things such as HTML and JSON. After going through these features, I’ll show how Randal Schwartz used them in his tiny JSON parser. This discussion also appears in chapter 2 of Mastering Perl, 2nd Edition, which you can read for free through O’Reilly’s Early Release program.
New to “Lightweight Persistence”
“Lightweight Persistence” has many changes. I covered Storable in the first edition, but since then it’s security problem has become more widely know. It’s easy to create a Storable file that can run unexpected code, for a couple of reasons.
Since I first wrote this book, YAML and JSON have become much more important, so I cover those. Continue reading “New to “Lightweight Persistence””
New to “Perl Debuggers”
I renamed this chapter to “Perl Debuggers” from “Debugging Perl”; it’s not really about the process of debugging but the tools to do it. Most of it has stayed the same, although I had to remove the unmaintained Devel::ebug::HTTP that uses old Catalyst code. That’s one of the reasons I don’t like tying such modules to frameworks. The people who like to make the frameworks like to reinvent them, leaving all of the legacy code behind.
You can read this chapter in O’Reilly Atlas.
New to “Profiling”
Devel::NYTProf, Adam Kaplan’s original creation and Tim Bunce’s ongoing gift to the Perl community, is the new star of my “Profiling” chapter. However, the static book format doesn’t do much to show it off.
Other than that, I went through all of the code and output with v5.18 to refresh it. Not much changed other than the times getting much faster almost a decade later.
You can read this chapter in O’Reilly Atlas.