line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package MIME::DecodeText; |
2
|
|
|
|
|
|
|
|
3
|
1
|
|
|
1
|
|
5663
|
use 5.006; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
31
|
|
4
|
1
|
|
|
1
|
|
5
|
use strict; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
24
|
|
5
|
|
|
|
|
|
|
|
6
|
1
|
|
|
1
|
|
872
|
use MIME::Base64; |
|
1
|
|
|
|
|
617
|
|
|
1
|
|
|
|
|
50
|
|
7
|
1
|
|
|
1
|
|
704
|
use MIME::QuotedPrint; |
|
1
|
|
|
|
|
179
|
|
|
1
|
|
|
|
|
384
|
|
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
require Exporter; |
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
our @ISA = qw(Exporter); |
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
our @EXPORT = qw( |
14
|
|
|
|
|
|
|
decode_text |
15
|
|
|
|
|
|
|
); |
16
|
|
|
|
|
|
|
our $VERSION = '0.01'; |
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
sub decode_text($) { |
21
|
0
|
|
|
0
|
0
|
|
my $s = shift; |
22
|
0
|
|
|
|
|
|
my $ret = ''; |
23
|
0
|
|
|
|
|
|
local ($/) = undef; |
24
|
|
|
|
|
|
|
|
25
|
0
|
|
|
|
|
|
my @ar = split ' ', $s; |
26
|
0
|
|
|
|
|
|
foreach my $substr (@ar) { |
27
|
0
|
|
|
|
|
|
$ret .= __decode($substr); |
28
|
|
|
|
|
|
|
} |
29
|
|
|
|
|
|
|
|
30
|
0
|
|
|
|
|
|
return $ret; |
31
|
|
|
|
|
|
|
} |
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
sub __decode($) { |
34
|
0
|
|
|
0
|
|
|
my $s = shift; |
35
|
0
|
|
|
|
|
|
my $ret = $s; |
36
|
0
|
|
|
|
|
|
local ($/) = undef; |
37
|
|
|
|
|
|
|
|
38
|
0
|
|
|
|
|
|
$s =~ /=\?(.+)?\?(.)\?/; |
39
|
0
|
|
|
|
|
|
my ($encoding,$type) = ($1,$2); |
40
|
|
|
|
|
|
|
|
41
|
0
|
|
|
|
|
|
$s =~ s/=\?.+?\?$type\?(.*)\?=/$1/g; |
42
|
|
|
|
|
|
|
|
43
|
0
|
0
|
|
|
|
|
if ( $type eq 'q' ) { |
|
|
0
|
|
|
|
|
|
44
|
0
|
|
|
|
|
|
$s =~ s/_/ /g; |
45
|
0
|
|
|
|
|
|
$ret = decode_qp($s); |
46
|
|
|
|
|
|
|
} elsif ( $type eq 'B' ) { |
47
|
0
|
|
|
|
|
|
$ret = decode_base64($s); |
48
|
|
|
|
|
|
|
} else { |
49
|
0
|
|
|
|
|
|
$ret = "$s "; |
50
|
|
|
|
|
|
|
} |
51
|
|
|
|
|
|
|
|
52
|
0
|
|
|
|
|
|
return $ret; |
53
|
|
|
|
|
|
|
} |
54
|
|
|
|
|
|
|
|
55
|
|
|
|
|
|
|
1; |
56
|
|
|
|
|
|
|
__END__ |