Perl release summary

The most significant features introduced for recent versions of the Perl scripting language. Depending on desired compatibility you'll want to support a minimum of v5.8 or v5.14.

5.22 2015-06-01

\$alias =
aliasing via reference
<<>>
safe readline ignoring open flags in arguments
/()/n
flag to disable numbered capturing, turning () into (?:)
/\b{}/
boundary types: gcb (grapheme cluster), sb (sentence), wb (word)
&.
& | ^ ~ consistently numeric, dotted operators for strings (experimental)
use re 'strict'
apply stricter syntax rules to regular expression patterns (experimental)
0x.beep+0
hexadecimal floating point notation with binary power; printf '%a' to display
Unicode
v7.0

5.20 2014-05-27

sub ($var)
subroutine signatures (experimental)
%hash{…}
hash slices return key+value pairs
[]->@*
postfix dereferencing (also e.g. $scalar->$* for $$scalar) (experimental)
use warnings 'once'; $a
variables $a and $b are exempt from used once warnings
Unicode
v6.3

5.18 2013-05-18

${^LAST_FH}
last read filehandle (used by $.)
/(?[ a + b ])/
regex set operations (character substraction -, unions &) (experimental)
my sub
lexical subroutines (also state, our) (experimental)
next $expression
loop controls allow runtime expressions
no warnings 'experimental::…'
mechanism for experimental features, as of now required for smartmatch
Unicode
v6.2

5.16 2012-05-20

__SUB__
current subroutine reference
fc, "\F"
unicode foldcase to compare case-insensitively
"\N{}"
automatic use charnames qw( :full :short )
Unicode
v6.1

5.14 2011-05-14

s///r
non-destructive substitution
/(?^)/
construct to reset to default modifiers
/(?{ m() })/
regular expressions can be nested in /(?{})/ and /(??{})/ (experimental until 5.20)
use re '/flags'
customise default modifiers
each $ref e.a.
array and hash container functions accept references (experimental)
FH->method
filehandle method calls load IO::File on demand (eg. STDOUT->flush)
Unicode
v6.0+#8

5.12 2010-04-12

package version
package NAME VERSION shorthand for our $VERSION
...
yada-yada operator: code placeholder
use 5.012
Implicit strict if use VERSION >= v5.12
… when
when is now allowed to be used as a statement modifier
use overload 'qr'
customisable conversion to regular expressions
/\N/
inverse \n to match any character except newline regardless of /s (experimental until 5.18)
Unicode
v5.2

5.10 2007-12-18

//
defined-or operator
~~
smart-match operator to compare different data types (updated in v5.10.1) (experimental)
given
switch statement to smart-match with when/default (experimental)
/(?<name>)/
named capture buffers into %+
s/keep\K//
floating positive lookbehind, efficient alternative for s/(keep)/$1/
/\v/, /\h/
vertical and horizontal whitespace escapes
my $_
lexically scoped version of the default variable (experimental)
Unicode
v5.0.0

5.8 2002-07-18

no utf8
full unicode support, utf8 pragma only for script encoding
binmode $fh, ':perlio'
file handle behaviour altered by PerlIO layers
open $fh, '-|', @cmd
open list to fork a command without spawning a shell
open $fh, '>', \$var
perl scalars as virtual files
printf '%1$s', @args
syntax to use parameters out of order
1_2_3 == 123
underscores between digits allowed in numeric constants
Unicode
v3.2.0

5.6 2000-03-23

use warnings
pragma to enable warnings in lexical scope
use utf8
experimental unicode semantics (completed in v5.8) (experimental until 5.8)
use charnames
string escape \N{} to insert named character
our
declare global variables
v1.2.3
represent strings as vector of ordinals, useful in version numbers (printf '%vd' to display)
0b0
binary numbers in literals, printf '%b', and oct
sub :lvalue
subroutine attribute to return a modifiable value (experimental until 5.20)
open my $fh, $mode, $expr
file handles in scoped scalars, third argument for unambiguous file name
pack 'q'
64-bit integer support (also large files >2GiB) (experimental until 5.8.1)
sort $coderef ()
comparison function can be a subroutine reference; prototype ($$) to pass elements as normal @_
CHECK {}
special block called at end of compilation
/[[:…:]]/
POSIX character class syntax such as /[[:alpha:]]/
Unicode
v3.0.1