Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw

Can't locate WWW/Mechanize/ in @INC

by Pavan Renjal (Initiate)
on Jan 16, 2013 at 18:59 UTC ( #1013635=perlquestion: print w/replies, xml ) Need Help??
Pavan Renjal has asked for the wisdom of the Perl Monks concerning the following question:

Can't locate WWW/Mechanize/ in @INC (@INC contains: C:/Perl/ +site/lib C :/Perl/lib .) at C:\Perl Scripts\ line 4. BEGIN failed--compilation aborted at C:\Perl Scripts\ line + 4.

I am trying to execute few examples provided in As suggested in this site, i have Mozrepl add on installed in my site. i also have LWP module installed

But i am not able to install this particular module WWW::Mechanize::Firefox. It appears that i have 2 versions of perl installed. I have 2 versions perl v5.8.3 (which came along with Oracle installation.) and perl v5.16.2 which had come with Active perl installation and because of which i believe i am facing these issues. I had executed one of the scripts that someone suggested in one of the forums to check INC and i recieved the following results:

C:\Perl Scripts> C:\Perl\lib C:\oracle\product\10.2.0\db_1\perl\5.8.3\lib\MSWin32-x86 C:\oracle\product\10.2.0\db_1\perl\5.8.3\lib/MSWin32-x86-multi-thread C:\oracle\product\10.2.0\db_1\perl\5.8.3\lib C:\oracle\product\10.2.0\db_1\perl\5.8.3\lib\MSWin32-x86 C:\oracle\product\10.2.0\db_1\perl\site\5.8.3 C:\oracle\product\10.2.0\db_1\perl\site\5.8.3\lib/MSWin32-x86-multi-th +read C:\oracle\product\10.2.0\db_1\perl\site\5.8.3\lib C:\oracle\product\10.2.0\db_1\sysman\admin\scripts C:\oracle\product\10.2.0\db_1\perl\lib\5.8.3\MSWin32-x86 C:\oracle\product\10.2.0\db_1\perl\lib\5.8.3 C:\oracle\product\10.2.0\db_1\perl\5.8.3\lib\MSWin32-x86-multi-thread C:\oracle\product\10.2.0\db_1\perl\site\5.8.3 C:\oracle\product\10.2.0\db_1\perl\site\5.8.3\lib/MSWin32-x86-multi-th +read C:\oracle\product\10.2.0\db_1\perl\site\5.8.3\lib C:\oracle\product\10.2.0\db_1\sysman\admin\scripts C:/Perl/site/lib C:/Perl/lib
I have tried to execute where perl and i got the following path:
C:\Perl Scripts>where perl C:\Perl\bin\perl.exe

I am using Windows 7 basic edition and i have installed Active Perl in my system to work with Perl. Please suggest how do i avoid this error and help me install www::mechanize::firefox correctly. If uninstalling Oracle would help then i would do that as well.

Replies are listed 'Best First'.
Re: Can't locate WWW/Mechanize/ in @INC
by Anonymous Monk on Jan 16, 2013 at 20:09 UTC
    So which perl are you calling? What doe  die $^X print?

      @AnonymousMonk: Thanks for the reply! I believe it should be the latest one that came with Active Perl installation perl v5.16.2, but i am really not sure whether perl script is executed with this version or not. Moreover, i am relatively new to perl. Can you please let me know where i need to execute die $^X command?

        Don't guess! The answer based on a guess has very little value as a response to a question from someone who's trying to help.

        Try the command suggested in Re: Can't locate WWW/Mechanize/ in @INC and then tell us what it does (more on this -- how to execute -- is below).
        And don't rely on external tools (either, which you don't show) nor where to tell you something about Perl that you can learn from your own Perl.

        $ perl -v ; perl -e "print join \"\n\", @INC" can both help, or, use this little piece of code, which appeared here recently:

        #! /usr/bin/perl use 5.016; # adjust to suit the version identified from the + C:> prompt with <c>perl -v
        use ExtUtils::Installed; my $module; my $inst = ExtUtils::Installed->new(); my (@modules) = $inst->modules(); foreach $module (@modules) { say "$module"; } </c>

        The die $^X command gets executed from your command prompt, "C:\>" by preference (mine, an idiosyncracy) like this:
        perl -E "die $^X;"
        which will print something like this: C:\Perl\bin\perl.exe at -e line 1. where the part before the "(period)exe" is your path to perl.

        ... but at a quick glance, it appears from the content of your second code block that you're executing Oracle's 5.8 version of Perl... in which case, perhaps you didn't ask (Active State?) to add 5.16 to your path. So check your path too... is there an instance of Perl that's not in an Oracle directory?

        Oh yes; @Annonymous Monk doesn't live here. But you can address Monks by name, by [name]... for example, to say your name to call you attention to this, I use that form of address: Pavan Renjal

        Update: (under the heading "use(), require(), do(), %INC and @INC Explained" may be illuminating.

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://1013635]
Approved by Lotus1
[karlgoethebier]: BTW: The Impact of Information Sources on Code Security

How do I use this? | Other CB clients
Other Users?
Others chanting in the Monastery: (4)
As of 2017-09-24 15:07 GMT
Find Nodes?
    Voting Booth?
    During the recent solar eclipse, I:

    Results (274 votes). Check out past polls.