For Programmers: Free Programming Magazines  


Home > Archive > Unix Programming > September 2006 > Perl Mail::Box









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Perl Mail::Box
jackley.cesar@gmail.com

2006-09-23, 10:00 pm

I tried to use Mail::Box in perl to open a
maillbox(/var/spool/mail/root) and process the messages but I keep
having this error:
Can't call method "open" on an undefined value at (eval
32)[/usr/lib/perl5/5.8.6/perl5db.pl:628] line 2.

The code is :
use Mail::Box::Manager;
my $mailspool = "/var/spool/mail/root";
my $mgr = Mail::Box::Manager->new;
my $folder = $mgr->open(folder => $mailspool);



Any help would be appreciated.

Thank you !

joe@invalid.address

2006-09-24, 7:01 pm

jackley.cesar@gmail.com writes:

> I tried to use Mail::Box in perl to open a
> maillbox(/var/spool/mail/root) and process the messages but I keep
> having this error:
> Can't call method "open" on an undefined value at (eval
> 32)[/usr/lib/perl5/5.8.6/perl5db.pl:628] line 2.
>
> The code is :
> use Mail::Box::Manager;
> my $mailspool = "/var/spool/mail/root";
> my $mgr = Mail::Box::Manager->new;
> my $folder = $mgr->open(folder => $mailspool);


The error message is saying that $mgr isn't defined, so it sounds like
the constructor failed. What does the module documentation say
about creating an object?

Joe

Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com