Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

Perl 5.26.0 Available

by kcott (Chancellor)
on May 31, 2017 at 05:09 UTC ( #1191664=perlnews: print w/replies, xml ) Need Help??

The latest version of Perl, 5.26.0, has just been released.

Here's the changes since 5.24.1: perldelta.

I've been using 5.25.9 (developer release) for a while because I wanted the Unicode 9.0 support. This included new features now available in 5.26.0. A couple I particularly liked are:

Indented Here-documents

This allows you to now write (after a couple of levels of indentation):

{ ... { ... my $boilerplate = <<~'EOT'; Boilerplate text ... EOT ... } ... }

Previously, without being able to add the tilde, meant code typically looked liked this (and the readability gains from indenting code were somewhat diminished):

{ ... { ... my $boilerplate = <<'EOT'; Boilerplate text ... EOT ... } ... }
New regular expression modifier /xx

While the '/x' modifier allows whitespace in most of a regex to improve readability, the '/xx' modifier allows whitespace in bracketed character classes also. This can be used to separate ranges and individual characters. As a quickly contrived example to capture the first and last character of strings starting with alphanumerics and ending with certain punctuation characters:

/^([A-Za-z0-9]).*?([!@#$%^&*])$/ / ^ ( [A-Za-z0-9] ) .*? ( [!@#$%^&*] ) $ /x / ^ ( [ A-Z a-z 0-9] ) .*? ( [ ! @ # $ % ^ & * ] ) $ /xx

It's been discussed here a few times recently, but also note: Removal of the current directory (".") from @INC

While I was writing this, I was also installing 5.26.0 (under perlbrew). I see it has already completed successfully: so that much works and, at least for me, didn't take very long.

— Ken

Replies are listed 'Best First'.
Re: Perl 5.26.0 Available
by vrk (Chaplain) on May 31, 2017 at 09:49 UTC

    Indented heredocs is one of those things that isn't a "killer feature" but once you start using it, you never want to go back. It's such a boost to convenience! I'm also pleased that lexical subroutines are stable enough to move from experimental to mainstream. Now, maybe in Perl 5.28 you can combine refaliasing and declared_refs with prototypes...

Re: Perl 5.26.0 Available
by Athanasius (Chancellor) on Jun 03, 2017 at 05:55 UTC

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: perlnews [id://1191664]
help
Chatterbox?
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others taking refuge in the Monastery: (4)
As of 2017-10-21 03:10 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    My fridge is mostly full of:

















    Results (269 votes). Check out past polls.

    Notices?