# print messages to both console and logfile sub PrintLogCon { print @_; print(LOG @_) or die "Error printing to $logfile: $!"; }