[San-Diego-pm] Perl 5.24

Christopher Grau chris.grau at gmail.com
Thu May 19 10:14:29 PDT 2016

On Wed, May 18, 2016 at 3:59 PM, Bob Kleemann <rkleeman at energoncube.net> wrote:
> Postfix dereferencing ( $array_ref->@* ) looks like it could be helpful
> sugar, but I'm not sure it's really going to solve a lot of problems, though
> it might, since they removed the auto-dereferencing in many internal
> functions ( keys $hash_ref isn't allowed, it's back to keys %$hash_ref or
> the new keys $hash_ref->%* ).  Time will definitely tell on that one.

I see it as a nice bit of syntactic sugar, which I may come to enjoy.
Recently, I saw an example for which it makes the code read more
naturally, left-to-right, rather than inside-out.

    foreach my $key ( keys $gimme_a_ref->()->@[0]->%* ) {


> I wish they would figure out smartmatch, so that it moves out of
> experimental.  I've found when(){} really helpful for undef, strings,
> numbers, and regexes (areas where it's not confusing what is going on).  I
> can see how arrays, hashes, functions, and several other types could be
> tough to figure out, so make those throw up the warning about experimental
> features and let the easy ones work.

Agreed. I've found the given/when syntax so nice. From what I've read,
a lot of people were annoyed that smart match was marked as
experimental after it was considered stable. Though in the end, I
think it was a good lesson and the Perl development team has been much
more thoughtful in how they implement and mark new features.

More information about the San-Diego-pm mailing list