in reply to Creating a table from text delimited by newlines

I'm not completely certain what you want the result to be, but I think this code does something like what you're looking for:
$line = ''; while (<FH>) { chomp; if (length) { $line .= "$_ "; } else { print <<"EOHTML"; <TR> <TD>Checkbox</TD> <TD>$line</TD> </TR> <TR bgcolor=#000066><TD WIDTH=298>&nbsp;</TD><TD WIDTH=298>&nbsp;</TD> +</TR> EOHTML $line = ''; } } if (length $line) { print <<"EOHTML"; <TR> <TD>Checkbox</TD> <TD>$line</TD> </TR> EOHTML }
Note that I replaced the regex with a call to length. I think this is a clearer way to check whether the line contained any text (after chomping, of course).

Your question would be clearer with sample input and output...