in reply to Stupid loops, or is it just me?

The loop you are showing is iterating over the array (1,1,0). Try replacing the commas in your for statements with semicolons.

Hope this helps.

antirice    
The first rule of Perl club is - use Perl
The
ith rule of Perl club is - follow rule i - 1 for i > 1