| 1 | #!/usr/local/bin/perl | ||||||||||
| 2 | |||||||||||
| 3 | 3 | ▶ | use IO::Uncompress::Bunzip2 qw( $Bunzip2Error ); | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 4 | 3 | ▶ | use strict ; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 5 | 3 | ▶ | use warnings ; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 6 | |||||||||||
| 7 | #die "Usage: gzcat file...\n" | ||||||||||
| 8 | # unless @ARGV ; | ||||||||||
| 9 | |||||||||||
| 10 | 3 | my $file ; | |||||||||
| 11 | my $buffer ; | ||||||||||
| 12 | 3 | my $s; | |||||||||
| 13 | |||||||||||
| 14 | 3 | ▶ | @ARGV = '-' unless @ARGV ; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 15 | |||||||||||
| 16 | 3 | foreach $file (@ARGV) { | |||||||||
| 17 | |||||||||||
| 18 | 4 | ▶ | my $gz = new IO::Uncompress::Bunzip2 $file | ||||||||
|
Branch: 1 branch
| |||||||||||
| 19 | or die "Cannot open $file: $Bunzip2Error\n" ; | ||||||||||
| 20 | |||||||||||
| 21 | 4 | ▶ | print $buffer | ||||||||
|
Branch: 1 branch
| |||||||||||
| 22 | while ($s = $gz->read($buffer)) > 0 ; | ||||||||||
| 23 | |||||||||||
| 24 | 4 | ▶ | die "Error reading from $file: $Bunzip2Error\n" | ||||||||
|
Branch: 1 branch
| |||||||||||
| 25 | if $s < 0 ; | ||||||||||
| 26 | |||||||||||
| 27 | 4 | $gz->close() ; | |||||||||
| 28 | } | ||||||||||