The following commit has been merged in the master branch:
commit 724811ab9580615c480344a396149f54e62cf6d2
Author: Guillem Jover <[email protected]>
Date: Thu Jan 3 03:32:55 2013 +0100
perl: Conditionally include modules with require instead of use
Fixes Modules::ProhibitConditionalUseStatements.
Warned-by: perlcritic
diff --git a/dselect/methods/Dselect/Ftp.pm b/dselect/methods/Dselect/Ftp.pm
index 930564c..f2afa3b 100644
--- a/dselect/methods/Dselect/Ftp.pm
+++ b/dselect/methods/Dselect/Ftp.pm
@@ -322,7 +322,7 @@ sub do_mdtm {
#}
if (! $has_mdtm) {
- use Time::Local;
+ require Time::Local;
my @files = $ftp->dir($file);
if (($#files == -1) || ($ftp->code == 550)) { # No such file or
directory
@@ -368,7 +368,7 @@ sub do_mdtm {
}
# build a system time
- $time = timegm (0, $minutes, $hours, $day, $month, $year);
+ $time = Time::Local::timegm(0, $minutes, $hours, $day, $month,
$year);
} else {
die 'Regexp match failed on LIST output';
}
diff --git a/scripts/dpkg-gensymbols.pl b/scripts/dpkg-gensymbols.pl
index 1c3cfb4..34334da 100755
--- a/scripts/dpkg-gensymbols.pl
+++ b/scripts/dpkg-gensymbols.pl
@@ -277,8 +277,8 @@ if ($compare || ! $quiet) {
}
unless ($quiet) {
- use File::Temp;
- use Digest::MD5;
+ require File::Temp;
+ require Digest::MD5;
# Compare template symbols files before and after
my $before = File::Temp->new(TEMPLATE=>'dpkg-gensymbolsXXXXXX');
my $after = File::Temp->new(TEMPLATE=>'dpkg-gensymbolsXXXXXX');
diff --git a/test/100_critic.t b/test/100_critic.t
index fda442b..9062075 100644
--- a/test/100_critic.t
+++ b/test/100_critic.t
@@ -62,6 +62,7 @@ my @policies = qw(
Miscellanea::ProhibitFormats
Miscellanea::ProhibitUnrestrictedNoCritic
Miscellanea::ProhibitUselessNoCritic
+ Modules::ProhibitConditionalUseStatements
Modules::ProhibitEvilModules
Modules::RequireBarewordIncludes
Modules::RequireEndWithOne
--
dpkg's main repository
--
To UNSUBSCRIBE, email to [email protected]
with a subject of "unsubscribe". Trouble? Contact [email protected]