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

DEAR MONKS

i am using active state perl 5.10

first i tried to download this module through GUI ppm

but .. i was unable to install it

next i downloaded the module from Cpan and namke.exe and paste in C:/perl/bin

extracted the above mentioned module in the bin directory

next..i open the dos prompt and entered the C:/perl/bin/www-mechanize-1.34>...

and gave the following command....perl Makefile.PL

nmake

nmake test

nmake install

up to here it installed properly

but when i am using the module in the program it is showing follwoing error

Can't locate WWW/Mechanize.pm in @INC (@INC contain: C/perl/sit/lib C:/perl/lib .) at C:/perl/bin/gmail. pl line 3

BEGIN failed--compilation aborted at C:\perl\bin\gmail.pl line 3.

Replies are listed 'Best First'.
Re: problem in installing WWW::Mechanize
by ambrus (Abbot) on Jun 09, 2008 at 17:14 UTC

    Corion hasn't used his telepathic powers on this one yet, so I'll try to use my weaker ones.

    1. Delete the use line that wants to include the module. Then add that use line again rewriting it from scratch. Try to see if this changes anything.
    2. Instead of scraping gmail with mechanize, get some modules that use the underlying protocols (POP3/IMAP to download email from your mailbox, SMTP to send mail, XMPP to chat).
    3. Update: if all else fails, try copying the exact source and the exact error message here. If possible, use a computer to copy them, don't copy by hand.

    (Note: there was some discussion in the chatterbox that precedes this.)

Re: problem in installing WWW::Mechanize
by moritz (Cardinal) on Jun 09, 2008 at 17:04 UTC
    first i tried to download this module through GUI ppm but .. i was unable to install it

    What prevent you from installing it? ppm seems to be the best way to install it, so it might be worth another try.

    Since your script is named gmail.pl, may I suggest you look at search.cpan.org for gmail modules? They might save you some work.

Re: problem in installing WWW::Mechanize
by tachyon-II (Chaplain) on Jun 09, 2008 at 17:42 UTC

    I suspect you have a typo in the name. The sit(e) is a typo. Have a look in the directory:

    C:\perl\site\lib\WWW\

    Do you see Mechanize.pm there? If so you have a typo in your use statement, if not you have not installed it because this is where it ends up. BTW you don't need to extract into C:\perl\bin\ to do an install. See A Guide To Installing Modules

Re: problem in installing WWW::Mechanize
by Anonymous Monk on Jun 10, 2008 at 07:04 UTC
    Don't download modules into perl\bin , so you can install by hand, just use cpan look WWW::Mechanize, or cpanp z WWW::Mechanize
      Hello all, I have a similar problem. In PPM the only relevant thing I see is "WWW-Mechanize-FormFiller," which I don't think is the same as WWW::Mechanize because it has a different author and because every time I try to use mechanize I get the same error that the thread starter got. Do I need to add more repositories to PPM? Thanks.
        Do I need to add more repositories to PPM?

        yes