in reply to Which method do I use to install a module ?

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

Replies are listed 'Best First'.
Re: Re: Which method do I use to install a module ?
by peterr (Scribe) on Nov 12, 2003 at 11:22 UTC
    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
        Dave,

        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.

        The install didn't work

        ppm> install Mail-Reporter Error: Package 'Mail-Reporter' not found. Please 'search' for it first +. ppm> install Mail-Box-Manager Error: Package 'Mail-Box-Manager' not found. Please 'search' for it first.

        However, when I look at what is included in the tar file (Mail-Box-2.051), I can see files 'reporter.pm' and 'reporter.pod' under the /Mail path, and also I can see files 'manager.pm' and 'manager.pod' under the /Mail/Box path

        Does that indicate that I should have used "option 3" instead of using PPM ?

        Where is PPM actually looking ? I know it goes out to the Internet, but is there a setting to force it to search in URL's that would contain these modules ?

        Peter