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

Eric Dorland <[email protected]> Tue, 24 May 2005 15:15:14 -0400
Newsgroups gmane.comp.lang.perl.modules.mail-box
Message-ID <[email protected]>
--LKTjZJSUETSlgu2t
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

* Mark Overmeer ([email protected]) wrote:
> * Eric Dorland ([email protected]) [050524 19:23]:
> > sub timestamp()
> > {   my $head =3D shift->head or return;
> >     $head->recvstamp || $head->timestamp;
> > }
>=20
> > For reasons I don't understand, in a boolean context,
>=20
> 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.
>=20
> > Mail::Message::Head::Delayed objects evaluate to false. So the line
> > "my $head =3D shift->head or return;"
>=20
> You are correct, this should simply be
>    my $head =3D shift->head;
> The lazy data loader will read the file.  Fix will be in next release.

Great, thanks!=20

--=20
Eric Dorland <[email protected]>
ICQ: #61138586, Jabber: [email protected]
1024D/16D970C6 097C 4861 9934 27A0 8E1C  2B0A 61E9 8ECF 16D9 70C6

-----BEGIN GEEK CODE BLOCK-----
Version: 3.12
GCS d- s++: a-- C+++ UL+++ P++ L++ E++ W++ N+ o K- w+=20
O? M++ V-- PS+ PE Y+ PGP++ t++ 5++ X+ R tv++ b+++ DI+ D+=20
G e h! r- y+=20
------END GEEK CODE BLOCK------

--LKTjZJSUETSlgu2t
Content-Type: application/pgp-signature; name="signature.asc"
Content-Description: Digital signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.1 (GNU/Linux)

iD8DBQFCk31CYemOzxbZcMYRAorYAJ49tSg/Kw82UuNpSFBNVCUF/Cd6IACfQ/lt
8rMEExTb9YkJarMFkDp6EVo=
=6VVt
-----END PGP SIGNATURE-----

--LKTjZJSUETSlgu2t--