Fellow monks, i am in need of your assistance. I am trying to use perl to clear the event log on NT4 and 2k machines. I am having no such luck. Here is the code that i have. Can anyone please help in pointing out what i am doing wrong. I am getting "no such file or directory" when i run this. needless to say, the code so far isn't doing anything.
Thanks in advance
Ray
#!/usr/bin/perl
use Win32::EventLog;
use strict;
my ($Event, $filename, $directory);
$directory = 'c:/EventLogs/';
for ('System', 'Security', 'Application') {
$Event = new Win32::EventLog ("$_", "");
$filename = $directory . $_ . '.evt';
$Event->Clear($filename)or die "Couldn't clear eventlogs: $!";
}