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

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

Thread Previous | Thread Next
May 31, 2008 15:44
Re: [perl #54974] Strange map {} Behavior When Returning Two Values
Message ID:
On Sat, May 31, 2008 at 11:34:22PM +0200, Bo Lindbergh wrote:
> In article <>,
> (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.


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