Here's how Report.pl works. The script first creates a hash with the event-log entry values. The script then creates an instance of the Win32::EventLog object and passes the hash to the Report() method, which creates the log entry.
If a message table uses multiple strings (e.g., string1, string 2), you need to pass in multiple strings when reporting an event. However, the Report() method doesn't support multiple strings in version 0.062 of Win32::EventLog. Although version 0.071 fixes this problem, you must use the null character ("\0") to separate multiple strings. A better solution is to use the WriteEventLog() function instead of the Report() method. The script Report2.pl uses the WriteEventLog() function to perform the same tasks as Report.pl. So, if you need to submit multiple strings, use Report2.pl rather than Report.pl.
You can use the reporting scripts Report.pl and Report2.pl many ways. You can call one of the reporting scripts from another script to write any errors that the calling script might encounter in an event log. You can even call a reporting script from a script to write a log entry that indicates that the calling script successfully executed. In addition, you can use a reporting script to log an event. Suppose you just replaced a SCSI drive; you can call Report.pl to make a note of this replacement in the event log when the SCSI drive boots up. . . .
Sylvain Grenon February 13, 2004