aboutsummaryrefslogtreecommitdiff
path: root/tests/ftpserver.pl
diff options
context:
space:
mode:
authorYang Tse <yangsita@gmail.com>2009-12-22 13:46:06 +0000
committerYang Tse <yangsita@gmail.com>2009-12-22 13:46:06 +0000
commit271dc9c5821d05c454936a0b8acad5aa0a09c8a7 (patch)
tree413735d2620de1db932a25a20675bf6720cbfacf /tests/ftpserver.pl
parent7bede9180dba30806d01e619a26140028143ee06 (diff)
use Time::HiRes whenever available, independently of perl version
Diffstat (limited to 'tests/ftpserver.pl')
-rw-r--r--tests/ftpserver.pl7
1 files changed, 5 insertions, 2 deletions
diff --git a/tests/ftpserver.pl b/tests/ftpserver.pl
index cb60172e0..0f5aa55fb 100644
--- a/tests/ftpserver.pl
+++ b/tests/ftpserver.pl
@@ -44,7 +44,9 @@ require "getpart.pm";
require "ftp.pm";
BEGIN {
- if($] >= 5.007003) {
+ # sub second timestamping needs Time::HiRes
+ eval {
+ no warnings "all";
require Time::HiRes;
import Time::HiRes qw( gettimeofday );
}
@@ -141,7 +143,8 @@ sub getlogfilename {
#
sub logmsg {
my $now;
- if($] >= 5.007003) {
+ # sub second timestamping needs Time::HiRes
+ if($Time::HiRes::VERSION) {
my ($seconds, $usec) = gettimeofday();
my ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) =
localtime($seconds);