Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

Re^2: Abusing Map (Corrected second code block)

by ikegami (Pope)
on May 18, 2018 at 08:11 UTC ( #1214819=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    my @b;
    $b[ $_-1 ] = $a[ $_-1 ] - $a[ $_ ] for 1 .. $#a;
    
  2. or download this
    my @b;
    $b[ $_ ] = $a[ $_ ] - $a[ $_+1 ] for 0 .. $#a-1;
    
  3. or download this
    my @b = @a;
    $b[ $_ ] -= $b[ $_+1 ] for 0 .. $#b-1;
    pop @b;
    

Log In?
Username:
Password:

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

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