peterr has asked for the wisdom of the Perl Monks concerning the following question:

Hi,

I'm using ActiveState Active Perl 5.8.0.806 on a Win32 box, and trying to run this

#C:\Perl\bin\Perl.exe -w use strict; use IO::File; use Data::Dumper; use Mail::Box; use Mail::Box::Manager; # Load mail list my $MailList = load_mail_list('./list25B6.txt'); print Dumper($MailList); # etc,etc

and I'm getting this message

D:\temp\myscripts>perl chkemail.pl Can't locate Mail/Box.pm in @INC (@INC contains: D:/Perl/lib D:/Perl/s +ite/lib .) at chkemail.pl line 5. BEGIN failed--compilation aborted at chkemail.pl line 5.

Obviously the module Mail::Box needs to be installed, but as you can see by this node, I'm not only a newbie to Perl, but even after reading the suggested - A Guide to installing modules , and digesting what I can, I now at a loss as to which method I _should_ use to install the module ???

Do I use ?

1. perl -MCPAN -e "shell"

2. Download Box.Pm from the authors site and place that in a folder called \Mail\Box

3. Download the complete 'tar.gz' file for module Mail::Box from the authors site (or CPAN), uncompress it and try and install it

4. Run PPM

5. CPAN Site ?

6 Some other method ??

Thanks, :)

Peter

Replies are listed 'Best First'.
Re: Which method do I use to install a module ?
by davido (Cardinal) on Nov 12, 2003 at 10:23 UTC
    The easiest way is to run ppm from the DOS command line.

    Once you're in PPM (you see a ppm> prompt), just type "install Mail-Box".

    Then type "exit" to leave PPM.

    At that point the module should be installed automatically if you followed those steps. Couldn't be easier. This is reliant upon the module being on ActiveState's Perl Module Repository. (it is, by the way; I just checked)


    Dave


    "If I had my life to live over again, I'd be a plumber." -- Albert Einstein
      Hi Dave,

      Thanks for that, the install using PPM worked okay, the first part was the "C Parser", then the final line said

      Successfully installed Mail-Box version 2.048 in ActivePerl 5.8.0.806.

      Now there are a heap of messages being produced like this

      Compilation failed in require at D:/Perl/site/lib/Mail/Box.pm line 10. BEGIN failed--compilation aborted at D:/Perl/site/lib/Mail/Box.pm line + 10. Compilation failed in require at chkemail.pl line 5. BEGIN failed--compilation aborted at chkemail.pl line 5.

      Is there any way I can pipe these messages to a file ? I tried

      perl chkemail.pl >chkemail.lis

      but the o/p file is empty

      Peter

        In looking at the POD for Mail::Box here I see that Mail::Box "is a" Mail::Reporter (inherets from). That leads me to believe you should also install the Mail::Reporter module in the same way you installed Mail::Box. Also, in looking at the documentation, the synopsis only shows Mail::Box being invoked as "use Mail::Box::Manager". I'm not sure why that is the case, not having used the module myself. But I suspect that the key is found in the Mail::Box Overview POD page, which is strongly recommended reading according to the POD for Mail::Box. (One of those "You did read that, didn't you?" type of statements indicates the strong recommendation). ...You did read that, right? ;)

        Maybe something in all that will tell you better what you're doing wrong.

        Also, to answer your followup question directly, you may spill error messages to another file but to catch compilation errors you would probably have to redirect STDERR to a file within a BEGIN block. But redirecting STDERR isn't really what you need to be concerned with. First, figure out what you need to do to use Mail::Box so that it doesn't generate errors. The key to your success in using CPAN modules is to read their documentation thoroughly. The small amount of time it takes to read the POD's for the modules is a very slight price to pay in comparison to the time you're saving by not having to write the module's code from scratch yourself.


        Dave


        "If I had my life to live over again, I'd be a plumber." -- Albert Einstein
Re: Which method do I use to install a module ?
by peterr (Scribe) on Nov 13, 2003 at 04:47 UTC
    Hi,

    I have been replying to this thread (the original node that I posted), instead of doing it via the "Seekers of Perl Wisdom". I thought doing the replies _that_ way, ensured they also showed up in the "Seekers of Perl Wisdom"

    Boy, am I dumb, or what !! :(

    Peter