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

Re: postfix dereference syntax

Thread Previous | Thread Next
Aaron Priven
August 15, 2013 18:35
Re: postfix dereference syntax
Message ID:

On Aug 15, 2013, at 11:19 AM, Ricardo Signes <> wrote:
> So: ->[] means "the array"
> But ->[1,2,3] means "the slice" (a list)
> And so ->[()] means "the slice of no elements (an empty list)
> It's bound to cause painful confusion.

On Aug 15, 2013, at 11:31 AM, Ricardo Signes <> wrote:
> Also, that's plausible for array references.  What about scalar references?

The part I don't get is why it's necessary to specify the type of dereferencing. 

I'm not seriously suggesting using this character, but suppose you had


(that's the registered trademark symbol)

Then whatever you had in $foo, it could be dereferenced, into whatever it is -- scalar, hash, array, glob, etc. There's no ambiguity there, is there?

Aaron Priven,,

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