Perl 5.22.0 Released
Written by Kay Ewbank   
Monday, 08 June 2015

The latest version of Perl has been released with a new double diamond operator, support for hexadecimal floating point numbers, and improved variable aliasing.

One major improvement is to the line input operator, <>. This accepts filenames stores in the @ARGV array, and if you pass a filename containing special characters, it might be possible to interact with the shell. A new line-input operator, <<>>, has been added that ignores special characters.

One controversial move is the removal of CGI.pm and Module::Build from the standard library. They are still available on CPAN, but the argument from the Perl maintainers is that they are no longer mainstream. CGI.pm was at one point the only way to generate HTML, along with many other features, but it has now been superseded and has been removed. As both CGI.pm and Module::Build were so widely used, you may find old code that assumes their presence will now throw an undeclared dependency – check your declarations.

The addition of variable aliases means you can now create an alias for a referenced value. You can also alias a subroutine.

According to the changes reference Perl Delta, variables and subroutines can now be aliased by assigning to a reference:

\$c = \$d;

\&x = \&y;

Aliasing can also be accomplished by using a backslash before a foreach iterator variable; this is perhaps the most useful idiom this feature provides:

foreach \%hash (@array_of_hash_refs) { ... }

This feature is experimental and must be enabled via use feature 'refaliasing'. It will warn unless the experimental::refaliasing warnings category is disabled.

Another improvement is the option to make use of repetition in list assignment. If you’re assigning one list of scalars to another, you can now avoid having a list of undefs, as in:

my(undef, $card_num, undef, undef, undef, $count) = split /:/;

and replace it with

my(undef, $card_num, (undef)x3, $count) = split /:/;

There’s a good description of this (and the other new features) in Brian Foy’s preview of Perl 5.22.

 

perlsq

Banner


JetBrains Announces TeamCity Pipelines
19/03/2024

JetBrains has released a public beta of TeamCity Pipelines, a cloud-based Continuous Integration/Continuous Deployment (CI/CD) service for small and medium-sized engineering teams.



Azure AI And Pgvector Run Generative AI Directly On Postgres
26/03/2024

It's a match made in heaven. The Azure AI extension enables the database to call into various Azure AI services like Azure OpenAI. Combined with pgvector you can go far beyond full text search. Let's  [ ... ]


More News

 

raspberry pi books

 

Comments




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

Last Updated ( Wednesday, 10 June 2015 )