http://qs1969.pair.com?node_id=216892

BioHazard has asked for the wisdom of the Perl Monks concerning the following question:

Fellow Monks,

I am recording the system uptime of my machine with a script shown below. By the time it is up for 49 days and 22 hours. Windows (XP) tells me so and a few other programs, too. Since this morning my Perl Script tells me:
Uptime: 0 days, 5 hours
The machine definitely did not reboot. So what is wrong with Win32::GetTickCount()?

Of course, there is another script which parses the milliseconds in days, hours, etc. But the main point is that the value of Win32::GetTickCount() seems to overswap or seems to do something else in a way.

Has anyone an idea? Thanks :)
Here's the script:

#!C:/Perl/bin/perl use strict; use Win32; use XML::Simple; my ($uptime, $xml, $lastupdate); while (1) { $uptime = Win32::GetTickCount(); $xml = XMLin("reg.xml", 'searchpath' => ['C:/Programme/Apache Grou +p/Apache/cgi-bin/uptime'], 'noattr' => 1); $xml->{'uptime'} = $uptime; if ($uptime > $xml->{'record'}) { $xml->{'record'} = $uptime; } $lastupdate = time(); $xml->{'lastupdate'} = $lastupdate; XMLout($xml, 'outputfile' => 'C:/Programme/Apache Group/Apache/cgi +-bin/uptime/reg.xml', 'noattr' => 1); sleep(600); } exit;

BioHazard
reading between the lines is my real pleasure