From b1a13e5e1453b6f776e0a35f293f4060c77fe59a Mon Sep 17 00:00:00 2001 From: Matthieu Patou Date: Mon, 18 Oct 2010 20:21:12 +0400 Subject: selftest: correct the import of Time::HighRes The "use" is always evaluated first even if enclosed into a if. So on plateform without Time::Hires (ie. sun8 in the build farm). This leads to an error. Instead we use the synthax require Module + Module->import("function") --- selftest/selftest.pl | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/selftest/selftest.pl b/selftest/selftest.pl index 08ee52c55e..7431bed8ed 100755 --- a/selftest/selftest.pl +++ b/selftest/selftest.pl @@ -135,9 +135,10 @@ use SocketWrapper; eval { require Time::HiRes; +Time::HiRes->import("time"); }; -unless ($@) { - use Time::HiRes qw(time); +if ($@) { + print "You don't have Time::Hires installed !\n"; } my $opt_help = 0; -- cgit