X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FNet%2FTime.pm;h=8b8be60bfd16df28fbac615b956c83e231437f42;hb=95d3daf003b5912b1fa6b2ac441449564fa0d970;hp=828babf717c96eb34e36136ec50ce3b1d3a263a1;hpb=406c51eefa6c9c4f403ef7f86adb46a627701935;p=p5sagit%2Fp5-mst-13.2.git diff --git a/lib/Net/Time.pm b/lib/Net/Time.pm index 828babf..8b8be60 100644 --- a/lib/Net/Time.pm +++ b/lib/Net/Time.pm @@ -1,6 +1,6 @@ # Net::Time.pm # -# Copyright (c) 1995-1998 Graham Barr . All rights reserved. +# Copyright (c) 1995-2004 Graham Barr . All rights reserved. # This program is free software; you can redistribute it and/or # modify it under the same terms as Perl itself. @@ -17,7 +17,7 @@ use IO::Select; @ISA = qw(Exporter); @EXPORT_OK = qw(inet_time inet_daytime); -$VERSION = "2.08"; +$VERSION = "2.10"; $TIMEOUT = 120; @@ -61,7 +61,7 @@ sub inet_time my $offset = 0 | 0; return undef - unless $s->recv($buf, length(pack("N",0))); + unless defined $s->recv($buf, length(pack("N",0))); # unpack, we | 0 to ensure we have an unsigned my $time = (unpack("N",$buf))[0] | 0; @@ -87,7 +87,7 @@ sub inet_daytime my $s = _socket('daytime',13,@_) || return undef; my $buf = ''; - $s->recv($buf, 1024) ? $buf + defined($s->recv($buf, 1024)) ? $buf : undef; } @@ -102,11 +102,11 @@ Net::Time - time and daytime network client interface =head1 SYNOPSIS use Net::Time qw(inet_time inet_daytime); - + print inet_time(); # use default host from Net::Config print inet_time('localhost'); print inet_time('localhost', 'tcp'); - + print inet_daytime(); # use default host from Net::Config print inet_daytime('localhost'); print inet_daytime('localhost', 'tcp'); @@ -140,7 +140,7 @@ Graham Barr =head1 COPYRIGHT -Copyright (c) 1995-1998 Graham Barr. All rights reserved. +Copyright (c) 1995-2004 Graham Barr. All rights reserved. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.