for $pid (0..$num_of_points-1) { for $polyid (0..$num_of_polygons-1) { 'do something' if } }