Re: parsing a mbox file in PERL
- From: Ben Morrow <ben@xxxxxxxxxxxx>
- Date: Thu, 29 Nov 2007 03:25:35 +0000
[quoting fixed. please don't top-post]
Quoth Madhusudhanan Chandrasekaran <mc79@xxxxxxxxxxxxxxx>:
On Wed, 28 Nov 2007, Jim Gibson wrote:<snip>
In article <Pine.SOL.4.56.0711281938240.20060@xxxxxxxxxxxxxxxxxxxxxx>,
Madhusudhanan Chandrasekaran <mc79@xxxxxxxxxxxxxxx> wrote:
Can't locate object method "new" via package "MIME::Parser" at
/usr/local/share/perl/5.8.8/Mail/MboxParser/Mail.pm line 513.
I've MIME::Parser installed and it does seem to have a new method.
Lines 511-515 of Mail::MboxParser.pm are as follows:
... and it looks like the code is not checking if the "require
MIME::Parser" worked :^(
Make sure MIME::Parser is installed properly. Try putting
warn("No MIME::Parser $@") if $@;
This isn't in general a very safe construction. There are too many ways
(destructors, signal handlers, etc.) in which $@ can get messed up.
Better is to make sure the eval returns true, and test for that:
eval {
require MIME::Parser;
1; # 5.8.0 has a bug where require in eval can return false
} or warn "No MIME::Parser: $@";
Of course, if something untoward happens the error message will be
wrong, but that's better than failing to catch the error at all.
after the eval.
Thanks for the response. It's like pandoras box,
more emerge. I get the following message that
Mail::Header is missing. But I cannot install
it for some weird reason -- The exact error I get
is as:
/bin/tar: MailTools-2.01: time stamp 2007-11-28 04:48:57 is
253591.077197246 s in the future
Your computer's clock is wrong. make depends on having the clock at
least approximately right, so you will need to fix this.
<snip>
==> Your Makefile has been rebuilt. <==
==> Please rerun the /usr/bin/make command. <==
false
MakeMaker is asking you to re-run make: if you do, it's possible it will
work correctly this time. It's probably better to fix your clock,
though.
Ben
.
- References:
- parsing a mbox file in PERL
- From: Madhusudhanan Chandrasekaran
- Re: parsing a mbox file in PERL
- From: Jim Gibson
- Re: parsing a mbox file in PERL
- From: Madhusudhanan Chandrasekaran
- parsing a mbox file in PERL
- Prev by Date: Re: page 124 of the camel book
- Next by Date: Re: equivalent controls
- Previous by thread: Re: parsing a mbox file in PERL
- Next by thread: FAQ 4.28 How do I change the Nth occurrence of something?
- Index(es):
Relevant Pages
|