... # now open the errorlog file for scan unless (open(LOG, "$sqlErrorlog")) { $ref->{log_open_error} = "***Error: could not open $sqlErrorlog for read. "; $ref->{log_open_error} .= Win32::FormatMessage(Win32::GetLastError); return $ref; } print "Error: $ref->{log_open_error}\n"; print "$sqlErrorlog\n"; # get the very first errorlog line. It has the version info. $_ = ; print "$_\n"; if (/^\s*([\d\/\-]+\s+[\d\:\.]+)\s+(?:kernel|Server|spid\d+)\s+(Microsoft\s+SQL\s+Server.+)/i) { ($ref->{first_recorded_date}, $ref->{sql_version}) = ($1, $2); print " DT: $ref->{first_recorded_date}\n"; print " Version: $2\n"; }