line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package MIME::Expander::Guess::FileName; |
2
|
|
|
|
|
|
|
|
3
|
3
|
|
|
3
|
|
28732
|
use strict; |
|
3
|
|
|
|
|
8
|
|
|
3
|
|
|
|
|
123
|
|
4
|
3
|
|
|
3
|
|
17
|
use warnings; |
|
3
|
|
|
|
|
7
|
|
|
3
|
|
|
|
|
99
|
|
5
|
3
|
|
|
3
|
|
14
|
use vars qw($VERSION); |
|
3
|
|
|
|
|
6
|
|
|
3
|
|
|
|
|
223
|
|
6
|
|
|
|
|
|
|
$VERSION = '0.01'; |
7
|
|
|
|
|
|
|
|
8
|
3
|
|
|
3
|
|
16
|
use base qw(MIME::Expander::Guess); |
|
3
|
|
|
|
|
6
|
|
|
3
|
|
|
|
|
922
|
|
9
|
3
|
|
|
3
|
|
9727
|
use MIME::Type::FileName; |
|
3
|
|
|
|
|
12683
|
|
|
3
|
|
|
|
|
448
|
|
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
sub type { |
12
|
9
|
|
|
9
|
0
|
25
|
my $class = shift; |
13
|
9
|
|
|
|
|
15
|
my $ref_contents = shift; |
14
|
9
|
|
100
|
|
|
34
|
my $info = shift || {}; |
15
|
9
|
|
|
|
|
14
|
my $name = $info->{filename}; |
16
|
|
|
|
|
|
|
|
17
|
9
|
100
|
|
|
|
30
|
return undef unless( defined $name ); |
18
|
|
|
|
|
|
|
|
19
|
7
|
|
|
|
|
25
|
my $mime = MIME::Type::FileName::guess($name); |
20
|
|
|
|
|
|
|
|
21
|
7
|
100
|
66
|
|
|
114
|
return undef if( $mime and $mime eq 'application/octet-stream' ); |
22
|
|
|
|
|
|
|
|
23
|
6
|
|
|
|
|
37
|
return $mime; |
24
|
|
|
|
|
|
|
} |
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
1; |
27
|
|
|
|
|
|
|
__END__ |