use strict; my @a = qw(10 20 30); my @b = qw( 1 2 3); # without 'for' (implicit loop) my @diff = map { $a[$_] - $b[$_] } 0..$#a; print "@diff\n"; # 9 18 27 # well, without a loop, but probably not useful in the general case... ;-) print join(" ", $a[0]-$b[0], $a[1]-$b[1], $a[2]-$b[2]), "\n";