瀏覽代碼

scripts: Do not use indirect object syntax

Fixes Objects::ProhibitIndirectSyntax.

Warned-by: perlcritic
Guillem Jover 13 年之前
父節點
當前提交
6e2750d65d
共有 3 個文件被更改,包括 4 次插入3 次删除
  1. 1 1
      scripts/dpkg-scanpackages.pl
  2. 2 2
      scripts/t/200_Dpkg_Shlibs.t
  3. 1 0
      test/100_critic.t

+ 1 - 1
scripts/dpkg-scanpackages.pl

@@ -172,7 +172,7 @@ defined($override) and (-e $override or
 
 $pathprefix //= '';
 
-my $find_h = new IO::Handle;
+my $find_h = IO::Handle->new();
 open($find_h, '-|', 'find', '-L', "$binarydir/", @find_args, '-print')
      or syserr(_g("Couldn't open %s for reading"), $binarydir);
 FILE:

+ 2 - 2
scripts/t/200_Dpkg_Shlibs.t

@@ -169,9 +169,9 @@ use File::Basename qw(basename);
 sub save_load_test {
     my ($symfile, $comment, @opts) = @_;
 
-    my $save_file = new File::Temp;
+    my $save_file = File::Temp->new();
     $symfile->save($save_file->filename, @opts);
-    my $dup = new Dpkg::Shlibs::SymbolFile(file => $save_file->filename);
+    my $dup = Dpkg::Shlibs::SymbolFile->new(file => $save_file->filename);
     # Force sync of non-stored attributes
     $dup->{file} = $symfile->{file};
     $dup->{arch} = $symfile->{arch};

+ 1 - 0
test/100_critic.t

@@ -66,6 +66,7 @@ my @policies = qw(
     Modules::RequireEndWithOne
     Modules::RequireExplicitPackage
     Modules::RequireFilenameMatchesPackage
+    Objects::ProhibitIndirectSyntax
     Subroutines::ProhibitExplicitReturnUndef
     Subroutines::ProhibitNestedSubs
     Subroutines::ProhibitReturnSort