in reply to Re^2: script fails loading module version, but > version is installed
in thread script fails loading module version, but > version is installed

Output %INC resp. $INC{"CGI.pm"} in the good and the bad case to see which file gets loaded from where.

Replies are listed 'Best First'.
Re^4: script fails loading module version, but > version is installed
by Allasso (Monk) on Jun 30, 2011 at 12:19 UTC
    yes, thanks. Two different places.

    so why is the script pointing to a different location than perl -e?

    And how do I change that?

        I see....

        yes, when I run:

        /usr/bin/perl -e 'use CGI ; print $INC{"CGI.pm"}."\n" ; '

        (the path following shebang of the script) instead of

        perl -e 'use CGI ; print $INC{"CGI.pm"}."\n" ; '

        I get the same include path as the script.

        I have another copy of perl in /opt/local/bin (the first entry in my PATH). Not sure why, unless Darwin Ports put it in there when I installed it (Mac OS X system)

        Installed CGI using:
        /usr/bin/perl Makefile.PL
        Now it finds it. Of course I see now that the output when running the install commands told me where it was installed all along. So clear now in hindsight.

        My thanks to all the patient and helpful monks - so much about computing I don't know. Thanks for the links.