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

Re: adder

by Abigail-II (Bishop)
on Aug 29, 2002 at 14:57 UTC ( [id://193793]=note: print w/replies, xml ) Need Help??


in reply to adder

Smells like homework to me. Anyway,
use strict; use warnings; sub adder (\@\@) {map {$_ += $_ [0] [$_ [2] ++]} @{$_ [1]}} my @one = (1, 2, 3, 4, 5); my @two = (6, 7, 8, 9, 10); adder @one => @two; print "@two\n"; __END__ 7 9 11 13 15
Explaining how it works is left as an exercise for the reader.

Abigail

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others goofing around in the Monastery: (3)
As of 2024-04-24 02:49 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found