Explorar el Código

Dpkg::Compression::FileHandle: Fix example code in SYNOPSIS

Make it compile.
Guillem Jover hace 10 años
padre
commit
96ffab9abd
Se han modificado 2 ficheros con 6 adiciones y 3 borrados
  1. 1 0
      debian/changelog
  2. 5 3
      scripts/Dpkg/Compression/FileHandle.pm

+ 1 - 0
debian/changelog

@@ -96,6 +96,7 @@ dpkg (1.18.8) UNRELEASED; urgency=medium
       and their format being inconsistent. In addition most got already
       removed in the past for the man pages.
     - Mark perlcritic as an optional author test dependency in the README.
+    - Fix example code in Dpkg::Compression::FileHandle SYNOPSIS.
 
   [ Updated programs translations ]
   * German (Sven Joachim).

+ 5 - 3
scripts/Dpkg/Compression/FileHandle.pm

@@ -45,6 +45,8 @@ Dpkg::Compression::FileHandle - object dealing transparently with file compressi
 
     use Dpkg::Compression::FileHandle;
 
+    my ($fh, @lines);
+
     $fh = Dpkg::Compression::FileHandle->new(filename => 'sample.gz');
     print $fh "Something\n";
     close $fh;
@@ -60,17 +62,17 @@ Dpkg::Compression::FileHandle - object dealing transparently with file compressi
     $fh->close();
 
     $fh = Dpkg::Compression::FileHandle->new(filename => 'sample.gz');
-    my @lines = <$fh>;
+    @lines = <$fh>;
     close $fh;
 
     $fh = Dpkg::Compression::FileHandle->new();
     open($fh, '<', 'sample.bz2');
-    my @lines = <$fh>;
+    @lines = <$fh>;
     close $fh;
 
     $fh = Dpkg::Compression::FileHandle->new();
     $fh->open('sample.xz', 'r');
-    my @lines = $fh->getlines();
+    @lines = $fh->getlines();
     $fh->close();
 
 =head1 DESCRIPTION