Note that @arr2 will be empty after that. You can use:@res = map { $_ - shift(@arr2) } @arr1;
if you want to preserve @arr2my $i = 0; @res = map { $_ - $arr2[$i++] } @arr1;
In reply to Re: compare arrays numbers
by zwon
in thread compare arrays numbers
by nicholaspr
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |