diff options
| author | fukachan <fukachan> | 2004-06-29 10:02:42 +0000 |
|---|---|---|
| committer | fukachan <fukachan> | 2004-06-29 10:02:42 +0000 |
| commit | ce0807500864b84210a239a550014fa6455dee76 (patch) | |
| tree | 59258c9a3edcf4a59b8e63aa7e3f8661fad54539 /fml/lib/Mail/Message | |
| parent | 27e4f0966de9ee30fdacd9a0ea588f8b8c440791 (diff) | |
| download | fml8-ce0807500864b84210a239a550014fa6455dee76.tar.gz fml8-ce0807500864b84210a239a550014fa6455dee76.tar.bz2 fml8-ce0807500864b84210a239a550014fa6455dee76.zip | |
overhaul:
o fix comments.
o fix messages/error messages.
o use //o if could.
o specify initial value.
Diffstat (limited to 'fml/lib/Mail/Message')
| -rw-r--r-- | fml/lib/Mail/Message/Address.pm | 28 |
1 files changed, 16 insertions, 12 deletions
diff --git a/fml/lib/Mail/Message/Address.pm b/fml/lib/Mail/Message/Address.pm index 714ecd96..a6585952 100644 --- a/fml/lib/Mail/Message/Address.pm +++ b/fml/lib/Mail/Message/Address.pm @@ -4,7 +4,7 @@ # All rights reserved. This program is free software; you can # redistribute it and/or modify it under the same terms as Perl itself. # -# $FML: Address.pm,v 1.2 2004/02/04 15:13:12 fukachan Exp $ +# $FML: Address.pm,v 1.3 2004/02/15 04:38:37 fukachan Exp $ # package Mail::Message::Address; @@ -22,10 +22,14 @@ Mail::Message::Address - manipulate address type string. =head1 DESCRIPTION +This class is an adapter for Mail::Address for convenience. + =head1 METHODS =head2 C<new()> +constructor. + =cut @@ -39,17 +43,18 @@ sub new my ($type) = ref($self) || $self; # parse it by Mail::Address. - my (@addrs) = Mail::Address->parse($str); - my $addr = $addrs[0]->address; + my (@addrs) = Mail::Address->parse($str) || (); + my $addr = $addrs[0]->address || ''; # XXX in-core data area. - # XXX this aread may break Mail::Address object, so - # XXX we not use @ISA to Mail::Address class but use it via AUTOLOAD(). + # XXX if we manipulate Mail::Address object, it is dangerous. So + # XXX not use @ISA to Mail::Address class but use it via AUTOLOAD() + # XXX as object composition. my $me = { _addrs => \@addrs, - _addr_head => $addrs[0], - _string => $addr, - _orig_string => $str, + _addr_head => $addrs[0] || '', + _string => $addr || '', + _orig_string => $str || '', }; return bless $me, $type; @@ -72,7 +77,7 @@ sub as_str =head2 clean_up() -clean up address and return it. +clean up address. no return value. =cut @@ -119,9 +124,8 @@ sub substr =head1 Mail::Address FORWARDING. -=head2 address() - -return address by string. +forward request to Mail::Address class. Forwarded requests follow: +phrase, address, comment, format, name, host, user, path, canon. =cut |
