line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package MIME::Expander::Guess::FileName; |
2
|
|
|
|
|
|
|
|
3
|
3
|
|
|
3
|
|
62478
|
use strict; |
|
3
|
|
|
|
|
6
|
|
|
3
|
|
|
|
|
128
|
|
4
|
3
|
|
|
3
|
|
16
|
use warnings; |
|
3
|
|
|
|
|
4
|
|
|
3
|
|
|
|
|
109
|
|
5
|
3
|
|
|
3
|
|
18
|
use vars qw($VERSION); |
|
3
|
|
|
|
|
6
|
|
|
3
|
|
|
|
|
208
|
|
6
|
|
|
|
|
|
|
$VERSION = '0.02'; |
7
|
|
|
|
|
|
|
|
8
|
3
|
|
|
3
|
|
18
|
use base qw(MIME::Expander::Guess); |
|
3
|
|
|
|
|
5
|
|
|
3
|
|
|
|
|
739
|
|
9
|
3
|
|
|
3
|
|
1831
|
use MIME::Type::FileName; |
|
3
|
|
|
|
|
8388
|
|
|
3
|
|
|
|
|
471
|
|
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
sub type { |
12
|
9
|
|
|
9
|
0
|
32
|
my $class = shift; |
13
|
9
|
|
|
|
|
16
|
my $ref_contents = shift; |
14
|
9
|
|
100
|
|
|
37
|
my $info = shift || {}; |
15
|
9
|
|
|
|
|
16
|
my $name = $info->{filename}; |
16
|
|
|
|
|
|
|
|
17
|
9
|
100
|
|
|
|
33
|
return undef unless( defined $name ); |
18
|
|
|
|
|
|
|
|
19
|
7
|
|
|
|
|
26
|
my $mime = MIME::Type::FileName::guess($name); |
20
|
|
|
|
|
|
|
|
21
|
7
|
100
|
66
|
|
|
162
|
return undef if( $mime and $mime eq 'application/octet-stream' ); |
22
|
|
|
|
|
|
|
|
23
|
6
|
|
|
|
|
51
|
return $mime; |
24
|
|
|
|
|
|
|
} |
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
1; |
27
|
|
|
|
|
|
|
__END__ |