develooper Front page | perl.perl5.porters | Postings from May 2008

Re: [perl #54974] Strange map {} Behavior When Returning Two Values

Thread Previous | Thread Next
From:
Abigail
Date:
May 31, 2008 15:44
Subject:
Re: [perl #54974] Strange map {} Behavior When Returning Two Values
Message ID:
20080531224406.GE1220@abigail.be
On Sat, May 31, 2008 at 11:34:22PM +0200, Bo Lindbergh wrote:
> In article <60CB2FCC-7405-4026-8119-4F7851F5BBB8@pobox.com>,
>  gbarr@pobox.com (Graham Barr) wrote:
> 
> >    %hash = map +( lc($_), 1 ), @array  # this is EXPR and works!
> 
> Add a note to perlop.pod about unary + being so utterly no-op that
> it doesn't even force scalar context?


Three quarters of the description of unary "+" is already dedicated
to describe exactly the situation above. Mentioning context doesn't
improve the current description, IMO. In fact, saying it doesn't force
scalar context will have some people assume it forces list context.



Abigail

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