my $infocounter = 1; while($assdata =~/(.*?)<\/td>/g){ [regex?!?] $infocounter++; }