Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

Re: map +

by tlm (Prior)
on Jun 21, 2005 at 11:07 UTC ( #468629=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    my %hash = map ( $_ => 1 ), @array;
    
  2. or download this
    (my %hash = map( $_, 1 )), @array;
    
  3. or download this
    my %hash = map +( $_ => 1 ), @array;
    
  4. or download this
    print +( $x ? $y : $z ), "\n";
    
  5. or download this
    (print( $x ? $y : $z )), "\n";
    
  6. or download this
    my @foo = map { 1, 2 } 3, 4;
    
  7. or download this
    my @foo = map { ; 1, 2 } 3, 4;
    print "@foo\n";
    __END__
    1 2 1 2
    
  8. or download this
    my @foo = map +{ 1, 2 }, 3, 4;
    
  9. or download this
    my @foo = map { 1, 2 }, 3, 4;
    print "@foo\n";
    __END__
    HASH(0x814cbb8) HASH(0x814cd5c)
    

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://468629]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (2)
As of 2023-02-07 02:42 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    I prefer not to run the latest version of Perl because:







    Results (38 votes). Check out past polls.

    Notices?