Monthly Archives: April 2010

Report any errors you find in Effective Perl Programming

Now that you should be able to get Effective Perl Programming, let us know if you find a problem. We’re going to keep a list of errata on this site. Make sure you check the current list before you spend your time reporting it to us. When you do find something, you can send it [...]

Use DBI_TRACE to follow DBI’s work.

There is a lot going on when you use DBI to interact with a database. Tack on a few layers of abstraction from Object Relational Modelers (ORM’s) such as DBIx::Class and you can end up with a tricky maze of subroutine calls to dig through when you need to track down issues. DBI comes with [...]

Effective Perl Programming is now in stock at Amazon!

Josh and I got hard copies of the Effective Perl Programming, Second Edition last week, and Amazon says they are in stock.

Effective Perl Programming’s table of contents

Here is the final table of contents for Effective Perl Programming, 2nd Edition. The “Item” references in our blog entries refer to the items in the book. We also have a map from the Item numbers in the first edition to those in the second, but we’ll have to do a little work to make [...]

Interact with the system when Perl isn’t enough

Usually, you want to do as much of your work inside your Perl program as you can. CPAN has a wealth of modules that accomplish many tasks, including those that you normally do very easily from the command line. In the cases where you can’t find a module, you might not be able to improve [...]

InformIT has an Effective Perl Item: Process HTML with a Perl Module

As part of the promotional package for Effective Perl Programming, I wrote Process HTML with a Perl Module for InformIT. It’s just like the Items that you see here, but on another site.

Effective Perl Programming is at the printers.

Effective Perl Programming, Second Edition has already gone to the printers and we’re expecting to see the real thing in about a week. It still has to make it to the distributors and wholesalers though, and Amazon is still listing it as available on May 7.

Use /gc and \G in matches to separate alternations in separate, smaller patterns

Perl keeps track of the last position in a string where it had a successful global match (using the /g flag). You can access this position with the pos operator. With Perl 5.10, you can use the /p switch to get the per-match variable ${^MATCH} instead of the performance-dampening $&: use 5.010; my $string = [...]

Know the difference between regex and match operator flags

The match and substitution operators, as well as regex quoting with qr//, use flags to signal certain behavior of the match or interpretation of the pattern. The flags that change the interpretation of the pattern are listed in the documentation for qr// in perlop (and maybe in other places in earlier versions of the documentation): [...]