Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

Re: Abusing Map (Corrected second code block)

by BrowserUk (Pope)
on May 16, 2018 at 16:52 UTC ( #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
Node Status?
node history
Node Type: note [id://1214671]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others studying the Monastery: (5)
As of 2021-01-25 15:13 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Notices?