http://www.perlmonks.org?node_id=134713
Category: NT Admin
Author/Contact Info Ray Espinoza
Description: This will clear local event log on a machine. No backup, just clear. We use this for machines that are ghosted and cleaned up for production.
# Ray Espinoza
# eventclear.pl
# This will clear the local eventlog to be used in the update.cmd scri
+pt for new builds.
######################################################################
+##################

#!/usr/bin/perl 
    use Win32::EventLog;
    use strict;
    
    my ($Event, $filename, $directory);
    $directory = 'c:/temp/';
    
    for ('System', 'Security', 'Application')    {
        $Event = new Win32::EventLog ("$_", "") || die "can't create o
+bject\n";
        $filename = $directory . $_ . '.evt';
        print " $filename exists\n" if (-e "$filename");
        $Event->Clear($filename)or warn " $!";
        $Event->Close();
        
            }