| line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
|
1
|
|
|
|
|
|
|
#!/usr/bin/perl |
|
2
|
|
|
|
|
|
|
|
|
3
|
1
|
|
|
1
|
|
4911
|
use strict ; |
|
|
1
|
|
|
|
|
1
|
|
|
|
1
|
|
|
|
|
35
|
|
|
4
|
1
|
|
|
1
|
|
3
|
use warnings ; |
|
|
1
|
|
|
|
|
2
|
|
|
|
1
|
|
|
|
|
53
|
|
|
5
|
1
|
|
|
1
|
|
557
|
use IO::Uncompress::Bunzip2 qw($Bunzip2Error); |
|
|
1
|
|
|
|
|
3
|
|
|
|
1
|
|
|
|
|
1618
|
|
|
6
|
|
|
|
|
|
|
|
|
7
|
1
|
50
|
|
|
|
185992
|
die "Usage: gzgrep pattern [file...]\n" |
|
8
|
|
|
|
|
|
|
unless @ARGV >= 1; |
|
9
|
|
|
|
|
|
|
|
|
10
|
1
|
|
|
|
|
4
|
my $pattern = shift ; |
|
11
|
1
|
|
|
|
|
2
|
my $file ; |
|
12
|
|
|
|
|
|
|
|
|
13
|
1
|
50
|
|
|
|
5
|
@ARGV = '-' unless @ARGV ; |
|
14
|
|
|
|
|
|
|
|
|
15
|
1
|
|
|
|
|
3
|
foreach $file (@ARGV) { |
|
16
|
2
|
50
|
|
|
|
112
|
my $gz = new IO::Uncompress::Bunzip2 $file |
|
17
|
|
|
|
|
|
|
or die "Cannot uncompress $file: $Bunzip2Error\n" ; |
|
18
|
|
|
|
|
|
|
|
|
19
|
2
|
|
|
|
|
14
|
while (<$gz>) { |
|
20
|
15
|
100
|
|
|
|
158
|
print if /$pattern/ ; |
|
21
|
|
|
|
|
|
|
} |
|
22
|
|
|
|
|
|
|
|
|
23
|
2
|
50
|
|
|
|
13
|
die "Error reading from $file: $Bunzip2Error\n" |
|
24
|
|
|
|
|
|
|
if $Bunzip2Error ; |
|
25
|
|
|
|
|
|
|
} |