Re: Problem with Mail::Message::Head::Delayed and timestamp()

Mark Overmeer <[email protected]> Tue, 24 May 2005 20:56:50 +0200
Newsgroups gmane.comp.lang.perl.modules.mail-box
Organization MARKOV Solutions
Message-ID <[email protected]>
* Eric Dorland ([email protected]) [050524 19:23]:
> sub timestamp()
> {   my $head = shift->head or return;
>     $head->recvstamp || $head->timestamp;
> }

> For reasons I don't understand, in a boolean context,

In boolean context, the first which returns a (true) value is returned,
so if recvstamp is finding something, that is used, otherwise the
timestamp method of the header is called.  The latter case will probably
only be used when the message is constructed by the program itself:
otherwise the received-timestamp is usually present.

> Mail::Message::Head::Delayed objects evaluate to false. So the line
> "my $head = shift->head or return;"

You are correct, this should simply be
   my $head = shift->head;
The lazy data loader will read the file.  Fix will be in next release.
-- 
               MarkOv

------------------------------------------------------------------------
drs Mark A.C.J. Overmeer                                MARKOV Solutions
       [email protected]                          [email protected]
http://Mark.Overmeer.net                   http://solutions.overmeer.net