#!perl use strict; use Win32::EventLog; # open the System event log my $log = new Win32::EventLog("Application") or die "Unable to open application log:$^En"; my $SupposedCount = 0; my $ActualCount = 0; #populate the Supposed Count $log->GetNumber($SupposedCount); # Now populate the ACTUAL count of events! while ($log->Read((EVENTLOG_SEQUENTIAL_READ|EVENTLOG_BACKWARDS_READ),1, my $entry)) { $ActualCount++; } print "Supposed Count: $SupposedCount\n"; print "Actual Count: $ActualCount\n"; #### --------------------- C:\>perl events.pl Supposed Count: 26382 Actual Count: 1261 -------------------