develooper Front page | perl.perl5.porters | Postings from July 2020

Re: So are refaliasing and declared_refs stable?

Thread Previous | Thread Next
Eric Brine
July 23, 2020 23:49
Re: So are refaliasing and declared_refs stable?
Message ID:
On Tue, Jul 21, 2020 at 3:41 PM Alexander Hartmaier <> wrote:

> I wonder why the postfix dereferencing syntax isn't used for a new
> features as that's newer and thus preferred way of dereferencing: my @a->@*
> = [];
> Is this even allowed? I guess not.

@a->@* means @{ @a }, which makes no sense.

1) It would be a strict refs error as you attempt to dereference a number,
except it doesn't even get that far.

2) Even if you used something legal on the LHS of the ->@*, this could
never work. Assigning to an array,  whether using @a = ... or $ref->@* =
..., already has a different meaning.

Dereferencing is the opposite of what's appropriate here. So it's not a
question which dereferencing syntax is or should be supported.

Thread Previous | Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About