Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
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
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 wandering the Monastery: (2)
As of 2020-05-25 17:10 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    If programming languages were movie genres, Perl would be:















    Results (146 votes). Check out past polls.

    Notices?