Re: "0" values in Mail::Message::Field::Full
Mark Overmeer <[email protected]> Wed, 15 Jun 2005 19:47:28 +0200
| Newsgroups | gmane.comp.lang.perl.modules.mail-box |
|---|---|
| Organization | MARKOV Solutions |
| Message-ID | <[email protected]> |
* Eugene L Schulman ([email protected]) [050615 18:20]: > Using Mail-Box v2.060 > Mail::Message::Field::Full apparently does not correctly handle "0" as a > field value. See below. > > # KLUDGE- Mail::Message::Field::Full appears to have a bug with a Value = > "0". Solution, add a leading space, which will get stripped later. > #$xvalue=" ".$xvalue if $xvalue eq "0"; > $ff=Mail::Message::Field::Full->new($xfield => $xvalue); > The real fix is a little more subtle. I hope it fixes all problems. In Mail::Message::Field::Full change sub new($;$$@) { my $class = shift; my $name = shift; my $body = @_ % 2 ? shift : undef; my %args = @_; - $body ||= delete $args{body}; + $body = delete $args{body} if defined $args{body}; Thanks for the report! -- MarkOv ------------------------------------------------------------------------ drs Mark A.C.J. Overmeer MARKOV Solutions [email protected] [email protected] http://Mark.Overmeer.net http://solutions.overmeer.net