# My requirement is to set a different background color # to rows depending on the "IF" conditions they satisfy. # Please help,what is the correct syntax while (my $line = <$IN>) { if ($line =~ /.*MATCH.*/) { $ret .= "$line \n"; } else { $ret .= "$line \n"; } } close $IN; return $ret;