print qq!<TD>$data</TD>\n!;
を
print $data eq "ぽち" ? qq!<td bgcolor="red">$data</td>\n! : qq!<TD>$data</TD>\n!;