Monthly Archives: May 2013

What New(ish) Perl features Do You Use?

Over on LinkedIn, someone asked me “What core PERL[sic] features do you use regularly that are new since 95?” It’s hard to be sure as the perldelta files only seem to go back to 1997 (for example, when were qw(...), q(...) and qq(...) added?), but here’s a quick list off the top of my head.

  • my was, of course, added in 5.0. But 5.004 added the ability to use it in control expressions – while (my $foo = <>) – and in foreach loops – foreach my $foo (@foos)
  • use VERSION
  • Regex extensions – (?<=RE) and similar. Oh, and qr/.../
  • Data::Dumper (added in 5.005)
  • Unicode support – first added in 5.6.0 and improved in every release since
  • our
  • Three-argument open
  • Omission of intermediate arrows in data structure lookups – $foo[$x][$y] instead of $foo[$x]->[$y]
  • use warnings
  • Memoize
  • Test::More and Test::Simple
  • say
  • defined-or
  • use base (or, more recently, use parent)
  • yada-yada operator

Have I missed anything obvious? What new Perl features do you use most?

Articles

I’ve been writing articles about Perl for a number of years. Because I have written for many people, the articles are currently spread out over a lot of different sites. I’ve decided to do something about this.

There’s now a new articles section on the site and over the next few weeks I plan to pull all of my Perl articles together in that section.

Currently, it just contains the seven articles that I wrote for perl.com. If you read them, please bear in mind the fact that they are all around ten years old and may well no longer reflect current best practices.

This coming weekend is a long weekend in the UK. This means that I may well find the time to republish a lot more articles.