Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
PerlMonks  

Re: Abusing Map (Corrected second code block)

by BrowserUk (Patriarch)
on May 16, 2018 at 16:52 UTC ( [id://1214671]=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    @b = map{ $a[ $_-1 ] + $a[ $_ ] } 1 .. $#a;
    
  2. or download this
    $b[ $_-1 ] = $a[ $_-1 ] + $a[ $_ ] for 1 .. $#a;
    

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others chilling in the Monastery: (3)
As of 2024-03-29 02:30 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found