in reply to output the read result into a log file

Hi, you are probably almost there now, but it's kind of hard to tell why your output file is empty, because we can't run this without reasonable data.

You can provide a few lines from the log at the end of your program:

__DATA__ log lines here and here a couple that should be ignored and a couple you think should be proccessed

Comment out the line that opens the logfile, and replace
while (<$fh>) {
with
while (<DATA>) {
to read from the embedded logdata. Also, delete lines you have commented out that is no longer going to be used. If you want, keep them in some document for reference, but get the clutter away.

cheers