in reply to Re: Looping
in thread Looping

How 1999. Why not be buzz-word compliant and use SOAP?

use SOAP::Lite; $year = SOAP::Lite -> uri('http://www.yearknower.com/Year') -> proxy('http://soap.yearnknower.com/year.cgi') -> get_this_year -> result;

-sam

PS: Am I the only one that finds the OO calling style of the SOAP::Lite POD (shown above) bizarre? Is there any known precident or did the author invent it?

Replies are listed 'Best First'.
Re: Re: Re: Looping
by bronto (Priest) on Jun 26, 2002 at 09:05 UTC

    Really good! I like your approach! And I think that robobunny got the point: if getting the right time is critical, you can't rely on yourself.

    Another solution would be to synchronize your server by means of the NTP protocol, which is the best way IMHO. I studied the principles of the protocol to implement a synchronization subnet for my job, and I was greatly surprised of how much statistical studies they put in; that makes NTP a higly-reliable protocol!

    Even if you don't want to invest a little to install a NTP server on your machine, you could take a look at the list of stratum 2 NTP servers and check if at least one of them offers the service by means of the daytime protocol too. To check, you can telnet to the tcp port 13 (i.e.: do a telnet host 13) and check if you get an output like:

    bronto@cooper:/tmp$ telnet myTimeServer 13 Trying 192.168.1.234... Connected to myTimeServer. Escape character is '^]'. Wed Jun 26 11:01:08 2002 Connection closed by foreign host.

    If so, you can get the current year using just Perl and Net::Telnet!

    Ciao!
    --bronto

    PS: if reading a document in italian language doesn't bother you, I can send a PDF doc I wrote about NTP and our synchronization subnet to anyone interested in. Just let me know!

    # Another Perl edition of a song:
    # The End, by The Beatles
    END {
      $you->take($love) eq $you->made($love) ;
    }