Re: $head->get issues possibly.

David A Golden <[email protected]>
Newsgroups gmane.comp.lang.perl.modules.mail-box
Message-ID <5.2.0.9.2.20040406001341.00b49730@localhost>
My suggestion is to either return it as a string and make explicit warnings 
in the docs that it may or may not be valid, or else try to return a 
DateTime object.  Or maybe both.  E.g. date() returns the string and 
datetime() returns a DateTime object.  Look at DateTime::Format::Mail and 
see if that will do well enough for getting the string to a standard 
date.  It has a "loose" parsing setting, but dies if unparseable so needs 
to be wrapped in an eval block.  Other DateTime::Format modules, e.g. 
::Strptime, might work as well.

David

At 4/5/2004 07:23 PM, Mark Overmeer wrote:
>* Roderick A. Anderson ([email protected]) [040406 01:20]:
> > On Mon, 5 Apr 2004, Mark Overmeer wrote:
> >   I thought I'd tried $msg->date and got even worst values returned.
> > Looks like I'll have to do some more testing of the returned value before
> > thinking it is a good date string.
>
>If you have a good solution, please tell me... I would like to improve
>$msg->date.
>--
>                MarkOv
>
>------------------------------------------------------------------------
>drs Mark A.C.J. Overmeer                                MARKOV Solutions
>        [email protected]                          [email protected]
>http://Mark.Overmeer.net                   http://solutions.overmeer.net
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.