I need a little help with the libwin32 Win32::EventLog module, please.  My
version of libwin32 is 0.18  My version of Perl is 5.6.1 build 531 on
Windows 2000 Pro.

Using the example #2 script right off of the CPAN documentation page

http://theoryx5.uwinnipeg.ca/CPAN/data/libwin32/EventLog/EventLog.html

and  changing only the servername and the path...

---------------------------------------------------------------
#!c:\perl\bin\
use Win32::EventLog;

$myServer="\\\\karen2";
 my($date)=join("-", ((split(/\s+/, scalar(localtime)))[0,1,2,4]));
 my($dest);

for my $eventLog ("Application", "System", "Security") {
      $handle=Win32::EventLog->new($eventLog, $myServer)
            or die "Can't open Application EventLog on $myServer\n";
      $dest="C:\\mike\\$myServer\\$eventLog\\$date.evt";
      $handle->Backup($dest)
            or warn "Could not backup and clear the $eventLog EventLog on
$myServer ($^E)\n";
      $handle->Close;
 }

----------------------------------------------------------------

I get only...

Could not backup and clear the Application EventLog on \\karen2 (The
parameter is incorrect)
Could not backup and clear the System EventLog on \\karen2 (The parameter
is incorrect)
Could not backup and clear the Security EventLog on \\karen2 (The parameter
is incorrect)


Any thoughts?  Running with -w gives me...

Use of uninitialized value in pattern match (m//) at
C:/Perl/site/lib/Win32/EventLog.pm line 72.
Use of uninitialized value in subroutine entry at
C:/Perl/site/lib/Win32/EventLog.pm line 72.
Could not backup and clear the Application EventLog on \\karen2 (The
parameter is incorrect)
Use of uninitialized value in pattern match (m//) at
C:/Perl/site/lib/Win32/EventLog.pm line 72.
Use of uninitialized value in subroutine entry at
C:/Perl/site/lib/Win32/EventLog.pm line 72.
Could not backup and clear the System EventLog on \\karen2 (The parameter
is incorrect)
Use of uninitialized value in pattern match (m//) at
C:/Perl/site/lib/Win32/EventLog.pm line 72.
Use of uninitialized value in subroutine entry at
C:/Perl/site/lib/Win32/EventLog.pm line 72.
Could not backup and clear the Security EventLog on \\karen2 (The parameter
is incorrect)


Line 72 of C:/Perl/site/lib/Win32/EventLog.pm  is the "if" line of the sub
new ...

sub new {
    die "usage: PACKAGE->new(SOURCENAME[, SERVERNAME])\n" unless @_ > 1;
    my ($class,$source,$server) = @_;
    my $handle;

    # Create new handle
    if (my $source !~ /\\/) {
      OpenEventLog($handle, $server, $source);
    }
    else {
      OpenBackupEventLog($handle, $server, $source);
    }
    return bless {handle   => $handle,
                  Source   => $source,
                  Computer => $server} => $class;
}


Any ideas??   Many thanks!

Glenn


_______________________________________________
Perl-Win32-Admin mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Reply via email to