in reply to Reliable time reference for timestamp?

Hi punch_card_don,

I haven't used it myself, but I'd be inclined to look at something like Net::NTP to start with.  It's an interface to NTP, which is the "Network Time Protocol".

Update:  Using this as an excuse to try something new, I just installed Net::NTP from CPAN.

Here's an example based on the documentation:

use strict; use warnings; + use Data::Dumper; use Net::NTP; + my %response = get_ntp_response(); printf "NTP results => %s\n", Dumper(\%response); __END__ NTP results => $VAR1 = { 'Version Number' => 3, 'Root Delay' => '0.129638671875', 'Precision' => -16, 'Leap Indicator' => 0, 'Stratum' => 4, 'Receive Timestamp' => '1179155054.2939', 'Transmit Timestamp' => '1179155054.29393', 'Reference Timestamp' => '1179154736.59929', 'Originate Timestamp' => '1179155054.38672', 'Poll Interval' => '0.0000', 'Reference Clock Identifier' => '192.168.10.150', 'Root Dispersion' => '0.0000', 'Mode' => 4 };

s''(q.S:$/9=(T1';s;(..)(..);$..=substr+crypt($1,$2),2,3;eg;print$..$/