line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Net::IMAP::Client::MsgAddress; |
2
|
|
|
|
|
|
|
|
3
|
1
|
|
|
1
|
|
5
|
use Encode (); |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
188
|
|
4
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
sub new { |
6
|
0
|
|
|
0
|
1
|
|
my ($class, $struct) = @_; |
7
|
0
|
|
|
|
|
|
my $self = { |
8
|
|
|
|
|
|
|
name => $struct->[0], |
9
|
|
|
|
|
|
|
at_domain_list => $struct->[1], |
10
|
|
|
|
|
|
|
mailbox => $struct->[2], |
11
|
|
|
|
|
|
|
host => $struct->[3], |
12
|
|
|
|
|
|
|
}; |
13
|
0
|
|
|
|
|
|
bless $self, $class; |
14
|
|
|
|
|
|
|
} |
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
sub _decode { |
17
|
0
|
|
|
0
|
|
|
my ($str) = @_; |
18
|
0
|
0
|
|
|
|
|
if (defined($str)) { |
19
|
0
|
|
|
|
|
|
eval { $str = Encode::decode('MIME-Header', $str); }; |
|
0
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
} |
21
|
0
|
|
|
|
|
|
return $str; |
22
|
|
|
|
|
|
|
} |
23
|
|
|
|
|
|
|
|
24
|
1
|
|
|
1
|
|
1819
|
use overload q("") => \&as_string; |
|
1
|
|
|
|
|
1038
|
|
|
1
|
|
|
|
|
9
|
|
25
|
|
|
|
|
|
|
|
26
|
0
|
|
|
0
|
1
|
|
sub name { _decode($_[0]->{name}) } |
27
|
0
|
|
|
0
|
1
|
|
sub at_domain_list { _decode($_[0]->{at_domain_list}) } |
28
|
0
|
|
|
0
|
1
|
|
sub mailbox { _decode($_[0]->{mailbox}) } |
29
|
0
|
|
|
0
|
1
|
|
sub host { _decode($_[0]->{host}) } |
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
sub email { |
32
|
0
|
|
|
0
|
1
|
|
my ($self) = @_; |
33
|
0
|
|
|
|
|
|
return $self->mailbox . '@' . $self->host; |
34
|
|
|
|
|
|
|
} |
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
sub as_string { |
37
|
0
|
|
|
0
|
1
|
|
my ($self) = @_; |
38
|
0
|
|
|
|
|
|
my $str; |
39
|
0
|
0
|
|
|
|
|
if (($str = $self->name)) { |
40
|
0
|
|
|
|
|
|
$str .= ' <' . $self->email . '>'; |
41
|
|
|
|
|
|
|
} else { |
42
|
0
|
|
|
|
|
|
$str = $self->email; |
43
|
|
|
|
|
|
|
} |
44
|
0
|
|
|
|
|
|
return $str; |
45
|
|
|
|
|
|
|
} |
46
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
1; |
48
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
__END__ |