Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

Re: map +

by tlm (Prior)
on Jun 21, 2005 at 11:07 UTC ( [id://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?Last hourOther CB clients
Other Users?
Others taking refuge in the Monastery: (3)
As of 2024-04-19 22:20 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found