in reply to Error/Warnings

Assuming that the lines in errort.log already have newelines at the end, and assuming you want to print the entire file, you can further simplify this as:
... open(LOG, "<$logfile") or die "$logfile: $!"; print "<pre>"; print <LOG>; print "</pre>\n"; close(LOG);

Update: Reasonable people are disagreeing on how to interpret your question. Please clarify: Are the warnings you want to avoid seeing 1) produced by the script, or 2) in the logfile?