Two features that I have previously discouraged are now gone from Perl. The lexical
$_ and auto dereferencing.
$_ was a consequence of the way Perl wanted smart match to work. In a
given-when, instead of aliasing
foreach does, the block had an implicit
my $_ = .... This interfered with the package version, as I wrote about in Use for() instead of given() and Perl v5.16 now sets proper magic on lexical $_. In Effective Perl Programming, we initially promoted this feature in Item 24: Use given-when to make a switch statement and Item 15: Use $_ for elegance and brevity. Our advice on lexical
$_ is dated and contrary to what we suggested for years. Now, with v5.24, it doesn’t matter because the feature is gone. (Reini Urban has more to say about this in The removal of the lexical topic feature in 5.24).
The other feature, automatic dereferencing for array and hash operators, I was never sold on. I’m not even settled on the notion that
values should be able to operate on both (chromatic wrote about it in Inadvertent Inconsistencies: each in Perl 5.12). This feature from v5.14 let you give you pass a scalar variable to the array and hash operators. You had to trust that the right sort of value would end up there since Perl could not check this at compile-time:
my @keys = keys $hash_or_array_reference;
I discouraged this in Don’t use auto-dereferencing with each or keys. The feature was confused even when it was stable, as you can read in Bug #80626 for perl5: More problems with push/keys $scalar. You can read the conversation about removing it in Bug #119437 for perl5: [EXPERIMENT] autoderef, the implicit deref in push REF and others. Now it’s gone too.