I don't see any syntax error in your for loops, but they might be written in a simpler and less error-prone fashion with something like this:
for my $i (0..$#sig) {
for my $j ($i+1..$#sig) {
print "$sig[$j]\n";
}
}
Perhaps it could be made even simpler, but I don't understand well enough what you intend to do to be able to suggest something that might get rid of one of the loops variables.
Update: Another possible way:
for my $i (0..$#sig) {
for my $item (@sig[$i+1..$#sig]) {
print "$item\n";
}
}
second update: fixed an off-by-one error in the first piece of code. Thanks to
AnomalousMonk for pointing it out.
third update: fixed yet another an off-by-one error . Thanks to AnomalousMonk for pointing it out.