The first Perl 5.22 release candidate is out and there are some new operators and many enhancements to regular expressions that look interesting, along with some improvements that don’t require any work from you. Some of the features are experimental, so be careful that you don’t create problems by overusing them until they settle down.
You can download the Perl source from CPAN. For Windows, Strawberry Perl 5.22 should be available once there’s an official release.
New features
- Perl knows what defined methods a class has and can call them faster
- Create aliases through references on both sides of an assignment or in a control variable.
- The new bitwise feature always uses numeric context
- The double-diamond line-input operator,
<<>>
reduces magic gotchas when dealing withARGV
(files implicitly opened from the command line) - The list form of a pipe open now works on Windows.
- Hexadecimal floating point values.
close
now puts its error in$!
and warns when an implicit close fails- The CGI and Module::Build modules are no longer in core Perl. You can still get them on CPAN.
Regex enhancements
- Special
\b
boundaries in regexes, including grapheme clusters, Unicode word boundaries, and sentence boundaries. - The new
/n
non-capturing regular expression flag makes all paren groups non-capturing. - The
re
module now has astrict
mode. - The
/xx
regex flag (doubled x) is deprecated because it will mean something later.
: Hexadecimal floating point values. WTF?
Hi there, Brian :-)
You know, those floating point values you have been using for all these years? Lies, all lies. They really are just bits. And since they are bits, they can be output as hex.
(On a more serious level: feature parity with C99 and Ruby: printf %a)
I guess that you’d would be one of the people who can read hexadecimal floating point numbers. But, you know that all the other numbers are bits too. :)
Ha! :smile: