Perl 5.28 Released
Written by Nikos Vaggalis   
Tuesday, 03 July 2018

Perl 5.28 doesn't introduce radical changes, but mainly focuses on optimizations, performance improvements, security fixes, cleanups, module upgrades and removals. We've combined this version's delta document with SawyerX's talk at TPC2018 in Salt Lake City to provide a more holistic summary of noteworthy changes.

 

Starting up with the new features,Perl 5.28 has been upgraded to support Unicode version 10.0, which now even incorporates the Bitcoin symbol!

Delete can now be used on key/value hash slices, returning the keys along with the deleted values. As SawyerX puts it :

my %sanitised_values=delete %input_values{@allowed_keys};

Alphabetic synonyms for regular expression assertions
This affects the Atomic grouping construct and the various lookarounds.

For example, positive lookahead is written as
/(?=pattern)/

but now can be made more readable
/(*pla:pattern)/

and even more readable as
/(*positive_lookahead:pattern)/

*script_run makes sure that multiple scripts can't be introduced in the same match, as a mixture of scripts such as Cyrillic and Latin can be the sign of a spoofing attack.

qr/(*script_run: \d+ \b )/x

??where the digits matched will all come from the same script.

Yada-yada operator ... has now become strictly a statement

 

Performance improvements and removals

  • The start up overhead for creating regular expression patterns with Unicode properties (\p{...}) has been greatly reduced.

  • The ref() builtin is now much faster in boolean context

  • Cleanup of internal Hash functions

  • Removal of use vars

  • Removal of :locked and :unique attributes

Future removals:

  • Assignment to $[ will be fatal in Perl 5.30

  • hostname() won't accept arguments in Perl 5.32

New Warnings

Old package separator used in string
(W syntax) You used the old package separator, "'", in a variable named inside a double-quoted string; e.g., "In $name's house". This is equivalent to "In $name::s house". If you meant the former, put a backslash before the apostrophe ("In $name\'s house").

A scenario under it as SawyerX puts it on his talk is when writing :

my $name='Pistachio';
print "In $name's house";

won't do what you expect.Rather Perl interprets the 2nd line as :

print "In $name::s house";


Updated Modules and Pragmata

  • B::Deparse has been upgraded from version 1.40 to 1.48.

  • B::Concise has been upgraded from version 0.999 to 1.003.

  • Archive::Tar has been upgraded from version 2.24 to 2.30 fixing the CVE-2018-12015: directory traversal vulnerability.

  • Charnames has been upgraded from version 1.44 to 1.45.

  • Devel::PPPort , a module that can enable features of higher Perl versions to older releases, has been upgraded from version 3.35 to 3.40

CPAN releases
Storable and File::Spec with Cwd have been finally released to CPAN as modules separate from the Core.

And lastly, Subroutine signatures which are surrounded by an unfortunate story, have been changed again. They were first introduced in 5.20, were changed in 5.22, and then it was discovered that :lvalue affects them adversely.  Hence in 5.28 they have been changed back to their 5.20 form.

 

On that matter, a compatibility feature not described in Perl delta but covered in SawyerX's talk is the post526fixsig script with which you can use any version of the Subroutine signatures, or both, regardless of the version of Perl you run .

        post526sigfix -d --pmc lib/My/Module.pm >lib/My/Module.pmc

        Options:
        -u, --upgrade       Upgrade 5.26 syntax to 5.28 syntax
        -d, --downgrade  Downgrade 5.28 syntax to 5.26 syntax
        -i, --inplace          Modify target file(s) in place
        --pmc                  Generate .pmc w/goto::file to load .pm on other

                                    versions
        
More info on that at http://www.trout.me.uk/perl/post526sigfix.txt 

 

 

More Information

5.28 Release on MetaCpan
5.28 Delta
5.28 POD

Related Articles

Perl 5.22.0 Released

Perl 5.20 And Mojolicious 5.0 Released

Perl 5.14 released

European Perl Conference In Glasgow, Massive Summer Event

Are Perl Programmers Different?

 

To be informed about new articles on I Programmer, sign up for our weekly newsletter, subscribe to the RSS feed and follow us on, Twitter, FacebookGoogle+ or Linkedin.

 

 

Banner


Paul Allen, Co-Founder of Microsoft, Dies
16/10/2018

Paul Allen, who with Bill Gates brought BASIC to the world and founded Microsoft, has died at the age of 65.



MongoDB Changes License
22/10/2018

MongoDB has revamped its open source license type in an attempt to prevent commercial organizations in Asia using the database commercially without sticking to the open source rules.


More News

 

Python

 



 

Comments




or email your comment to: comments@i-programmer.info

Last Updated ( Tuesday, 03 July 2018 )