Perl 5.10 introduced many new features that had built up over the years. Some of these we covered in the book, but we’ll cover some of those that we neglected. It might take us some time to get around to them all, but we’ll eventually make it. If you want to read about some sooner than others, let us know.
We covered these in the book:
given-when
(Item 24: Usegiven-when
to make a switch statement)- Use named captures (Item 31: Use named captures to label matches)
- Use relative back references (Item 31: Use named captures to label matches)
- Automatically add newlines with
say
(Item 2: Enable new Perl features when you need them) - Use lexical versions of
$_
(Item 15: Use$_
for elegance and brevity) - Declare persistent variables with
state
(Item 49: Create closures to capture data) - Stacked filetests (Item 51: Don’t ignore the file test operators)
We’ll cover these on the website:
- branch reset grouping,
(?|pattern)
- The defined-or operator,
//
- The
<
and>
pack format modifiers for endianness - The
mro
pragma for method resolution order - Define grammars in regular expressions
- The
\K
escape resets the match UNITCHECK
blocks- The \R generic line ending in regular expressions
- Match Unicode characters by property value
DOES
- The
_
prototype - Recursive sort subroutines
- Source filters in
@INC
- Expanded tainting checked for
$AUTOLOAD
andprintf
format strings. - Recursive patterns
- Uninitialized value warnings now contain the name of the variable with the undefined value.