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, |
In reply to Re: subtract two columns from perl arrays
by Athanasius
in thread subtract two columns from perl arrays
by agreen54
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |