if ( $log =~ /.tar.gz$/ ) { unless ( open LOG, "<:gzip", $log ){ log_msg (LOG_ERR, "Cannot open $log for read : File may be corrupt"); next; } }