line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Email::MIME::RFC2047::AddressList; |
2
|
|
|
|
|
|
|
$Email::MIME::RFC2047::AddressList::VERSION = '0.95'; |
3
|
4
|
|
|
4
|
|
16555
|
use strict; |
|
4
|
|
|
|
|
9
|
|
|
4
|
|
|
|
|
143
|
|
4
|
4
|
|
|
4
|
|
21
|
use warnings; |
|
4
|
|
|
|
|
6
|
|
|
4
|
|
|
|
|
140
|
|
5
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
# ABSTRACT: Handling of MIME encoded address lists |
7
|
|
|
|
|
|
|
|
8
|
4
|
|
|
4
|
|
17
|
use base qw(Email::MIME::RFC2047::Parser); |
|
4
|
|
|
|
|
8
|
|
|
4
|
|
|
|
|
1261
|
|
9
|
|
|
|
|
|
|
|
10
|
4
|
|
|
4
|
|
919
|
use Email::MIME::RFC2047::Decoder; |
|
4
|
|
|
|
|
8
|
|
|
4
|
|
|
|
|
134
|
|
11
|
4
|
|
|
4
|
|
1058
|
use Email::MIME::RFC2047::Address; |
|
4
|
|
|
|
|
5
|
|
|
4
|
|
|
|
|
1228
|
|
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
sub new { |
14
|
22
|
|
|
22
|
1
|
47
|
my $class = shift; |
15
|
|
|
|
|
|
|
|
16
|
22
|
|
|
|
|
34
|
my $self = [ @_ ]; |
17
|
|
|
|
|
|
|
|
18
|
22
|
|
|
|
|
68
|
return bless($self, $class); |
19
|
|
|
|
|
|
|
} |
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
sub parse { |
22
|
20
|
|
|
20
|
1
|
11205
|
my ($class, $string, $decoder) = @_; |
23
|
20
|
100
|
|
|
|
44
|
my $string_ref = ref($string) ? $string : \$string; |
24
|
20
|
|
66
|
|
|
101
|
$decoder ||= Email::MIME::RFC2047::Decoder->new(); |
25
|
|
|
|
|
|
|
|
26
|
20
|
|
|
|
|
15
|
my @addresses; |
27
|
|
|
|
|
|
|
|
28
|
20
|
|
|
|
|
17
|
do { |
29
|
40
|
|
|
|
|
85
|
my $address = $class->_parse_item($string_ref, $decoder); |
30
|
33
|
|
|
|
|
95
|
push(@addresses, $address); |
31
|
|
|
|
|
|
|
} while ($$string_ref =~ /\G,/cg); |
32
|
|
|
|
|
|
|
|
33
|
13
|
50
|
66
|
|
|
56
|
if (!ref($string) && pos($string) < length($string)) { |
34
|
0
|
|
|
|
|
0
|
return $class->_parse_error($string_ref); |
35
|
|
|
|
|
|
|
} |
36
|
|
|
|
|
|
|
|
37
|
13
|
|
|
|
|
40
|
return $class->new(@addresses); |
38
|
|
|
|
|
|
|
} |
39
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
sub _parse_item { |
41
|
19
|
|
|
19
|
|
23
|
my ($class, $string_ref, $decoder) = @_; |
42
|
|
|
|
|
|
|
|
43
|
19
|
|
|
|
|
46
|
return Email::MIME::RFC2047::Address->parse( |
44
|
|
|
|
|
|
|
$string_ref, $decoder |
45
|
|
|
|
|
|
|
); |
46
|
|
|
|
|
|
|
} |
47
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
sub items { |
49
|
5
|
|
|
5
|
1
|
18
|
my $self = shift; |
50
|
|
|
|
|
|
|
|
51
|
5
|
|
|
|
|
32
|
return @$self; |
52
|
|
|
|
|
|
|
} |
53
|
|
|
|
|
|
|
|
54
|
|
|
|
|
|
|
sub push { |
55
|
13
|
|
|
13
|
1
|
33
|
my $self = shift; |
56
|
|
|
|
|
|
|
|
57
|
13
|
|
|
|
|
16
|
push(@$self, @_); |
58
|
|
|
|
|
|
|
|
59
|
13
|
|
|
|
|
16
|
return; |
60
|
|
|
|
|
|
|
} |
61
|
|
|
|
|
|
|
|
62
|
|
|
|
|
|
|
sub format { |
63
|
7
|
|
|
7
|
1
|
16
|
my ($self, $encoder) = @_; |
64
|
7
|
|
33
|
|
|
19
|
$encoder ||= Email::MIME::RFC2047::Encoder->new(); |
65
|
|
|
|
|
|
|
|
66
|
7
|
|
|
|
|
15
|
return join(', ', map { $_->format($encoder) } @$self); |
|
13
|
|
|
|
|
33
|
|
67
|
|
|
|
|
|
|
} |
68
|
|
|
|
|
|
|
|
69
|
|
|
|
|
|
|
1; |
70
|
|
|
|
|
|
|
|
71
|
|
|
|
|
|
|
__END__ |