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:
David E. Wheeler
Date:
May 28, 2008 10:55
Subject:
Re: [perl #54974] Strange map {} Behavior When Returning Two Values
Message ID:
A144D51C-985B-44D8-B53E-3B6BA27ADE91@kineticode.com
On May 28, 2008, at 10:08, A. Pagaltzis via RT wrote:

> Because Perl thinks you are constructing an anonymous hash. If you
> disambiguate, it figures it out:
>
>    my @a = map {; "--$_" => $_ } @ARGV;
>
> Note the semicolon.

Would it not also think that it was an anonymous hash when I used the  
concatenation, as well?

Best,

David

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