Преглед изворни кода

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

Make it compile.
Guillem Jover пре 10 година
родитељ
комит
96ffab9abd
2 измењених фајлова са 6 додато и 3 уклоњено
  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
       and their format being inconsistent. In addition most got already
       removed in the past for the man pages.
       removed in the past for the man pages.
     - Mark perlcritic as an optional author test dependency in the README.
     - Mark perlcritic as an optional author test dependency in the README.
+    - Fix example code in Dpkg::Compression::FileHandle SYNOPSIS.
 
 
   [ Updated programs translations ]
   [ Updated programs translations ]
   * German (Sven Joachim).
   * 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;
     use Dpkg::Compression::FileHandle;
 
 
+    my ($fh, @lines);
+
     $fh = Dpkg::Compression::FileHandle->new(filename => 'sample.gz');
     $fh = Dpkg::Compression::FileHandle->new(filename => 'sample.gz');
     print $fh "Something\n";
     print $fh "Something\n";
     close $fh;
     close $fh;
@@ -60,17 +62,17 @@ Dpkg::Compression::FileHandle - object dealing transparently with file compressi
     $fh->close();
     $fh->close();
 
 
     $fh = Dpkg::Compression::FileHandle->new(filename => 'sample.gz');
     $fh = Dpkg::Compression::FileHandle->new(filename => 'sample.gz');
-    my @lines = <$fh>;
+    @lines = <$fh>;
     close $fh;
     close $fh;
 
 
     $fh = Dpkg::Compression::FileHandle->new();
     $fh = Dpkg::Compression::FileHandle->new();
     open($fh, '<', 'sample.bz2');
     open($fh, '<', 'sample.bz2');
-    my @lines = <$fh>;
+    @lines = <$fh>;
     close $fh;
     close $fh;
 
 
     $fh = Dpkg::Compression::FileHandle->new();
     $fh = Dpkg::Compression::FileHandle->new();
     $fh->open('sample.xz', 'r');
     $fh->open('sample.xz', 'r');
-    my @lines = $fh->getlines();
+    @lines = $fh->getlines();
     $fh->close();
     $fh->close();
 
 
 =head1 DESCRIPTION
 =head1 DESCRIPTION