in reply to Unknown Arithmetic Warning: Cannot determine source

Not solving your warning, but

print "Begin: i=[$i], cur[2]=[",$cur[2],"], win[2]=[", $win[2], "]", "\n";

You could save yourself some typing there because array elements can interpolate quite happily in double-quoted strings. I have also added escaped sigils so you can see them in the output.

$ perl -e ' > @cur = (1, 2, 3); @win = (4, 5, 6); $i = 66; > print "Begin: \$i=[$i], \$cur[2]=[$cur[2]], \$win[2]=[$win[2]]\n";' Begin: $i=[66], $cur[2]=[3], $win[2]=[6] $

I hope this is useful.

Cheers,

JohnGG