in reply to compare arrays numbers

@res = map { $_ - shift(@arr2) } @arr1;
Note that @arr2 will be empty after that. You can use:
my $i = 0; @res = map { $_ - $arr2[$i++] } @arr1;
if you want to preserve @arr2