for ($mycount = 1; $mycount <=9; $mycount++) { my $te = new HTML::TableExtract ( depth => 1, count => $mycount ); # more stuff }