I am unable to get the close function to work in Win32::Eventlog module.
My test script simply tries to open the System event log and then close
it.

use strict;

use Win32::EventLog;
my $log;
$log = Win32::EventLog->new("System", "") || die "unable to open, $!\n";
$log->Close() || die "unable to close,$!\n";

The output I get from running this is the following.

D:\SiteReviews>tester2.pl
unable to close,No such file or directory

On a higher level what I am trying to do is to create a backup copy of
the 3 NT event logs, clear all events from the backups (not the actual
logs, but the backups), and then copy "of interest" events (usually
Error and Warnings) from the main event log to the backup event log.
The clear method fails and it seems to be due to the Close method not
working correctly. Hence the test script above.

Can anyone see what I'm doing wrong and suggest how to fix it? Or
suggest another approach to the larger picture?

Thank you

Bill Young

Reply via email to