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

Re: postfix dereference syntax

Thread Previous | Thread Next
From:
Eric Brine
Date:
August 20, 2013 18:35
Subject:
Re: postfix dereference syntax
Message ID:
CALJW-qH6x2x6MQSmMvYBKo-bZwOVmLsCkKWd5BW6dyJfqu-tJA@mail.gmail.com
On Tue, Aug 20, 2013 at 1:38 PM, Zefram <zefram@fysh.org> wrote:

> Eric Brine wrote:
> >$ can return a list of scalars in addition to a scalar.
>
> I think you're getting confused about what the sigil applies to. $foo or
> ${...} always represents a scalar, never a list.  In "$foo->bar", the $
> sigil applies to the "$foo" part, and accurately indicates that it is
> a scalar.  That the "bar" method can return a list doesn't invalidate
> the consistency of the sigil's meaning.
>

You seem to have missed the context. demerphq was saying $foo->@* returned
a list instead of a scalar, breaking the pattern. He was clearly looking
past the "->".

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