190 karma · joined July 18, 2012
% perl -v | head -2
This is perl 5, version 40, subversion 0 (v5.40.0) built for x86_64-linux
%
% perl -E 'use feature "switch"; my ($x, $y); given ($x) { $y = 1 when /^abc/ }'
given is deprecated at -e line 1.
when is deprecated at -e line 1.
This is also mentioned in the docs: Smartmatch is now seen as a failed experiment and was marked as deprecated in Perl 5.37.10.
This includes the when and given keywords, as well as the smartmatch operator ~~.
The feature will be removed entirely in the Perl 5.42.0 production release.
https://perldoc.perl.org/perldeprecation#Smartmatch>> In python you can't tell whats a variable and whats a list, and whats a dictionary by looking.
In Perl, sigils are used to distinguish between scalars/lists/hashes. Sigils and references are not the same thing.
Moose out of the box has its own set of problems, leading to other workarounds, e.g.
Moo (a similar but much less bloated solution)
MooseX::Extended - Moose with more sensible/correct defaults
https://metacpan.org/dist/MooseX-Extended/view/lib/MooseX/Ex...
In practice, this has turned out to be a mixed blessing because of how tedious it is to do this repeatedly. So over the years there have been many libraries created to make this easier, each with different features.
There's currently work underway to modernise Perl's built in OO to address these problems.
On the other hand, this makes some things easier, e.g. Design by Contract can be added to Perl just by writing a library.
Another example, adding traits to PHP required updating PHP itself, whereas in Perl there are libraries to do that.
References are a PITA - cumbersome to use, and they make code less readable.
Perl doesn't have first class functions (you can pass or return functions via references, but that's cumbersome and less readable compared to languages with better FP support).