develooper Front page | perl.perl5.porters | Postings from August 2013

Re: postfix dereference syntax

Thread Previous | Thread Next
From:
Eric Brine
Date:
August 15, 2013 14:11
Subject:
Re: postfix dereference syntax
Message ID:
CALJW-qF40nWFpSJBkkLmcU06DUOwRXkkcz1KZQ5rSuCPaQupTg@mail.gmail.com
On Wed, Aug 14, 2013 at 4:44 PM, Brad Baxter <bmb@mail.libs.uga.edu> wrote:

> That is to say, with [ @{...} ], I know exactly where the entity being
> dereferenced begins and ends.  With [ ...->@* ] --phew--you got me.
>

Knowing a chain of similar operators end is rarely if ever a concern.

Having to maintain yet another mental a mental note (e.g. that an array
deref will eventually be performed) while reading a long chain of
expressions is.

This features allows code to be placed where it's performed instead of far
in advance.

@{${$h{a}[0]}

vs

$h{a}[0]->@*

(btw, can that arrow be omitted?)

Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About