diff options
| author | fukachan <fukachan> | 2002-04-28 13:34:15 +0000 |
|---|---|---|
| committer | fukachan <fukachan> | 2002-04-28 13:34:15 +0000 |
| commit | a1deb717ee1aa15d13d58fbb30b17536f1b401b8 (patch) | |
| tree | 96e10d8cefd582df39208dfcd16142bf16fb4796 /fml/lib/FML/Header.pm | |
| parent | 898e2ca19b8eebaf3d768872997d6ddeaedf5cf6 (diff) | |
| download | fml8-a1deb717ee1aa15d13d58fbb30b17536f1b401b8.tar.gz fml8-a1deb717ee1aa15d13d58fbb30b17536f1b401b8.tar.bz2 fml8-a1deb717ee1aa15d13d58fbb30b17536f1b401b8.zip | |
validate by defined() more
Diffstat (limited to 'fml/lib/FML/Header.pm')
| -rw-r--r-- | fml/lib/FML/Header.pm | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/fml/lib/FML/Header.pm b/fml/lib/FML/Header.pm index 7936cac6..3ca677a9 100644 --- a/fml/lib/FML/Header.pm +++ b/fml/lib/FML/Header.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: Header.pm,v 1.39 2001/12/23 09:20:41 fukachan Exp $ +# $FML: Header.pm,v 1.40 2002/04/08 12:44:23 fukachan Exp $ # package FML::Header; @@ -138,12 +138,17 @@ sub address_clean_up my @addrlist = Mail::Address->parse($addr); # only the first element in the @addrlist array is effective. - $addr = $addrlist[0]->address; - $addr =~ s/^\s*<//; - $addr =~ s/>\s*$//; + if (defined $addrlist[0]) { + $addr = $addrlist[0]->address; + $addr =~ s/^\s*<//; + $addr =~ s/>\s*$//; - # return the result. - return $addr; + # return the result. + return $addr; + } + else { + return undef; + } } |
