in reply to how to repeat a if else statement in a nested for loop

Your two nested loops could boild down to:
for my $a (0..$i) { for my $s (0..$s) { if ($a != $s) { # do something } } }
But it really makes very little sense.