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?
Leave a Reply