in reply to subtract two columns from perl arrays
Hello agreen54,
As others have said, we won’t write the code for you (PerlMonks is a teaching site, not a code-writing service). But I will give you two hints on possible ways to approach this task:
Use a C-style for loop to iterate over the indices of the two arrays. See perlsyn#For-Loops. Update: GrandFather (below) is of course correct, prefer a Perl-style for loop! (What was I thinking?) See perlsyn#Foreach-Loops.
Look at the pairwise function in the module List::MoreUtils.
Hope that helps,
| Athanasius <°(((>< contra mundum | Iustus alius egestas vitae, eros Piratica, |
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: subtract two columns from perl arrays
by GrandFather (Saint) on Nov 12, 2013 at 03:42 UTC | |
by dbuckhal (Chaplain) on Nov 12, 2013 at 04:18 UTC |