syphon has asked for the wisdom of the Perl Monks concerning the following question:
So in this script, I would expect $SupposedCount and $ActualCount to be identical, however, this is the script's output:#!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";
Any ideas what I'm doing wrong here? Why is it skipping so many events?--------------------- C:\>perl events.pl Supposed Count: 26382 Actual Count: 1261 -------------------
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Win32::EventLog not returning all events?
by BrowserUk (Patriarch) on Oct 12, 2011 at 00:35 UTC | |
by syphon (Initiate) on Oct 12, 2011 at 02:18 UTC | |
|
Re: Win32::EventLog not returning all events?
by Anonymous Monk on Oct 13, 2011 at 09:09 UTC |