develooper Front page | perl.perl5.porters | Postings from March 2000

Re: [ID 20000317.003] missing slice of reference

From:
Ronald J Kimball
Date:
March 18, 2000 08:46
Subject:
Re: [ID 20000317.003] missing slice of reference
Message ID:
20000318114227.A55960@linguist.dartmouth.edu
On Sat, Mar 18, 2000 at 04:27:12PM +0100, Johan Vromans wrote:
> "M.J.T. Guy" <mjtg@cus.cam.ac.uk> writes:
> 
> > Once you've accepted @x->[2] as a shorthand for (\@x)->[2],
> 
> I know a much better shorthand for (\@x)->[2]: $x[2].
> 
> > these are all features.
> 
> Even: print scalar(@cast)->{age}->{name}; \N{GREAT QUESTIONMARK}

The -> operator already puts its left hand operand in scalar context, so
the explicit call to scalar is redundant.

Compare to:

@x+7
scalar(@x)+7

Ronald



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