Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
PerlMonks  

Answer: Can I multiply corrosponding numbers in two arrays together? if so how?

by jreades (Friar)
on Nov 29, 2000 at 21:21 UTC ( [id://43956]=note: print w/replies, xml ) Need Help??

Something like this should work if I've read your question correctly:

my @results = (); my @first = (1, 2, 3, 4, 5); my @second = (1, 2, 3, 4, 5); for (0..$#first) { $results[$_] = $first[$_] * $second[$_]; } print @results, "\n";
  • Comment on Answer: Can I multiply corrosponding numbers in two arrays together? if so how?
  • Download Code

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others wandering the Monastery: (7)
As of 2024-04-23 07:45 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found