You seem to be editing your post continuously, I hope by the time I submit this the snippet in question won't be outdated... although you seem to be adding to your examples, not modifying (apparently you're working on 1,001 ways to write a loop)
In example #2:
$a[$_] -= $b[$_] for (),0..$#a;
# ^-- ... why?
What is up with the stray ()
? Just a typo, or are you doing something else here (I thought you might be somehow forcing list context, but 0..$#a
is a list anyway).
Without the spare empty list, the expression evaluates equivalently in my perl (5.10.0).