Subject: | Can't locate object method "end_of_file" |
Date: | Thu, 26 Feb 2009 17:14:15 +0100 |
To: | bug-Mail-Mbox-MessageParser [...] rt.cpan.org |
From: | Daniel Maher <dma [...] witbe.net> |
Mail-Mbox-MessageParser-1.5000
This is perl, v5.8.0 built for i386-linux-thread-multi
Linux 2.6.14.4 #3 SMP Wed Dec 21 13:23:23 CET 2005 i686
Red Hat Enterprise Linux ES release 3 (Taroon)
Can't locate object method "end_of_file" via package "No data on
filehandle" (perhaps you forgot to load "No data on filehandle"?) at
./parse_mbox.pl line 40.
#!/usr/bin/perl -wl
use strict;
use Mail::Mbox::MessageParser;
my $inbox = "/var/spool/mail/bnpmail-internet";
my $handle = new FileHandle($inbox);
my $reader = new Mail::Mbox::MessageParser( {
'file_name' => $inbox,
'file_handle' => $handle,
'enable_cache' => 0
} );
my $email;
while ( ! $reader->end_of_file() ) {
$email = $reader->read_next_email();
[perform a small action]
}
The error happens _sometimes_, but i've yet to figure out what causes
it. Occasionally i will run the script over and over and it will happen
3 out of 4 times, and other times only sparingly. The quantity or
type of mail in the inbox does not seem to affect it in any way.