line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package File::Compressible; |
2
|
|
|
|
|
|
|
|
3
|
1
|
|
|
1
|
|
23330
|
use strict; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
34
|
|
4
|
1
|
|
|
1
|
|
6
|
use warnings; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
28
|
|
5
|
|
|
|
|
|
|
|
6
|
1
|
|
|
1
|
|
5
|
use List::Util 'first'; |
|
1
|
|
|
|
|
6
|
|
|
1
|
|
|
|
|
120
|
|
7
|
1
|
|
|
1
|
|
5
|
use Exporter 'import'; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
245
|
|
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
our $VERSION = '1.00'; |
10
|
|
|
|
|
|
|
our @EXPORT_OK = (qw(compressible)); |
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
our @compressible = qw( |
13
|
|
|
|
|
|
|
application/octet-stream |
14
|
|
|
|
|
|
|
application/x-sh |
15
|
|
|
|
|
|
|
application/x-executable-file |
16
|
|
|
|
|
|
|
application/postscript |
17
|
|
|
|
|
|
|
application/x-csh |
18
|
|
|
|
|
|
|
application/x-perl |
19
|
|
|
|
|
|
|
application/x-awk |
20
|
|
|
|
|
|
|
application/x-javascript |
21
|
|
|
|
|
|
|
application/x-dvi |
22
|
|
|
|
|
|
|
application/pdf |
23
|
|
|
|
|
|
|
application/msword |
24
|
|
|
|
|
|
|
application/rtf |
25
|
|
|
|
|
|
|
application/x-tar |
26
|
|
|
|
|
|
|
application/x-gtar |
27
|
|
|
|
|
|
|
); |
28
|
|
|
|
|
|
|
push @compressible, 'Lisp/Scheme program text'; |
29
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
our @compressible_re = ( qr|^text/|o, qr|^message/|o ); |
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
sub compressible { |
33
|
7
|
|
|
7
|
0
|
24
|
my $mime_type = shift; |
34
|
7
|
100
|
|
96
|
|
45
|
return 1 if first { $_ eq $mime_type } @compressible; |
|
96
|
|
|
|
|
105
|
|
35
|
6
|
|
|
|
|
20
|
for my $re (@compressible_re) { |
36
|
11
|
100
|
|
|
|
57
|
return 1 if $mime_type =~ m/$re/; |
37
|
|
|
|
|
|
|
} |
38
|
4
|
|
|
|
|
19
|
return; |
39
|
|
|
|
|
|
|
} |
40
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
1; |
42
|
|
|
|
|
|
|
__END__ |