Can't locate Config.pm in @INC

Ken

I have a Perl app on my development server that I would like to replicate on my local machine (mac osx). I'm not a perl programmer by trade (I'm a PHP/Rails developer), and the developer of this app is no longer around so I can't contact him for help. I've gotten pretty close to getting it to work. I was able to install all the packages using CPAN (at least I think I got them all) but I keep running into the following error:

Can't locate WebCNP/Config.pm in @INC (
    @INC contains: /Library/Perl/5.16/darwin-thread-multi-2level 
                   /Library/Perl/5.16 
                   /Network/Library/Perl/5.16/darwin-thread-multi-2level 
                   /Network/Library/Perl/5.16 
                   /Library/Perl/Updates/5.16.2/darwin-thread-multi-2level 
                   /Library/Perl/Updates/5.16.2 
                   /System/Library/Perl/5.16/darwin-thread-multi-2level 
                   /System/Library/Perl/5.16 
                   /System/Library/Perl/Extras/5.16/darwin-thread-multi-2level 
                   /System/Library/Perl/Extras/5.16 .
    ) 
    at webcnp_lib.pl line 30.

On the server, the app's file structure looks like this:

/var/www/cgi-bin (empty dir)
/var/www/conf
/var/www/error
/var/www/html (empty dir)
/var/www/icons
/var/www/perl (the config file is located in this directory)
    - /WebCNP/Config.pm
/var/www/ssi (all the .pl files for the app are located here, including all the JS and CSS files)

Line 30 of /var/www/ssi/webcnp_lib.pl has the following:

use WebCNP::Config;

Any ideas what I could be doing wrong?

Just so you know I've copied the file structure of the app from my development server to my local machine and created a virtual host so that it points to the app's root directory (/var/www).

Thanks in advanced for any insight!

David W.

was able to fix this with a symbolic link

ln -s /path/to/my/app/WebCNP /Library/Perl/5.16/WebCNP

I take this isn't a module from CPAN.

I would be a bit hesitant to use a symbolic link. This will work, but you're basically linking in a file you have under your own control to the master /Library directory on MacOS X. You delete your file, and that link won't be pointing to anything.

You can use use lib to add directories that contain your modules to the @INC directory:

use lib qw(/path/to/my/app);

This will now include this path for module searches.

If you rather install the module itself, why not simply copy it into /Lbrary/Perl/5.16 itself? It's what cpan would have done. At least this way, you're Perl module directory isn't dependent upon a link that can be removed.

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

Can't locate Moo.pm in @INC

From Dev

Can't locate File/Remote.pm in @INC (@INC contains:

From Dev

Can't locate XML/XPath.pm in @INC

From Dev

Can't locate Switch.pm in @INC in Ubuntu 16.04 LTS

From Dev

Why Do I get Can't locate Module/Find.pm in @INC

From Dev

Can't locate Spreadsheet/ParseExcel.pm in @INC though it's seems to be installed

From Dev

git checkout --patch, but failed, Can't locate Git.pm in @INC

From Dev

Can't locate XML/DOM.pm in @INC (you may need to install the XML::DOM module)

From Dev

Can't locate Email/Sender/Transport/SMTP/TLS.pm in @INC

From Dev

Perl, Can't locate Packet/UDP/Syslog.pm in @INC | custom modules

From Dev

Can't locate Spreadsheet/ParseExcel.pm in @INC though it's seems to be installed

From Dev

Bugzilla 5.0 install on OpenShift - Can't locate parent.pm in @INC

From Dev

Can't locate XML/DOM.pm in @INC (you may need to install the XML::DOM module)

From Dev

Can't locate DBI.pm in @INC (you may need to install the DBI module)

From Dev

Perl Compilation Error: "Can't locate local/lib.pm"

From Dev

Can't locate Digest/MD5.pm directadmin

From Dev

Can't locate IO/Pty.pm - but it is installed

From Dev

Failing to compile DBD-Oracle-1.74 | Can't locate DBI.pm

From Dev

Launchpad builderror - Can't locate Debian/Debhelper/Sequence/python3.pm

From Dev

phpmyadmin is working fine but I can't find config.inc.php file?

From Dev

I Can't Find dompdf_config.inc.php or dompdf_config.custom.inc.php for setting "DOMPDF_UNICODE_ENABLED" true

From Dev

I Can't Find dompdf_config.inc.php or dompdf_config.custom.inc.php for setting "DOMPDF_UNICODE_ENABLED" true

From Dev

Can't locate LWP

From Dev

Perl can't locate object method "query_form" via package "URI::_foreign" at Geo::Coder::Google::V3.pm

From Dev

Selenium can't locate this element

From Dev

Can't locate ImageIcon in JButton

From Dev

Can't locate checkbox in webform

From Dev

Can't locate path: <0>

From Dev

Can't locate the GET request

Related Related

  1. 1

    Can't locate Moo.pm in @INC

  2. 2

    Can't locate File/Remote.pm in @INC (@INC contains:

  3. 3

    Can't locate XML/XPath.pm in @INC

  4. 4

    Can't locate Switch.pm in @INC in Ubuntu 16.04 LTS

  5. 5

    Why Do I get Can't locate Module/Find.pm in @INC

  6. 6

    Can't locate Spreadsheet/ParseExcel.pm in @INC though it's seems to be installed

  7. 7

    git checkout --patch, but failed, Can't locate Git.pm in @INC

  8. 8

    Can't locate XML/DOM.pm in @INC (you may need to install the XML::DOM module)

  9. 9

    Can't locate Email/Sender/Transport/SMTP/TLS.pm in @INC

  10. 10

    Perl, Can't locate Packet/UDP/Syslog.pm in @INC | custom modules

  11. 11

    Can't locate Spreadsheet/ParseExcel.pm in @INC though it's seems to be installed

  12. 12

    Bugzilla 5.0 install on OpenShift - Can't locate parent.pm in @INC

  13. 13

    Can't locate XML/DOM.pm in @INC (you may need to install the XML::DOM module)

  14. 14

    Can't locate DBI.pm in @INC (you may need to install the DBI module)

  15. 15

    Perl Compilation Error: "Can't locate local/lib.pm"

  16. 16

    Can't locate Digest/MD5.pm directadmin

  17. 17

    Can't locate IO/Pty.pm - but it is installed

  18. 18

    Failing to compile DBD-Oracle-1.74 | Can't locate DBI.pm

  19. 19

    Launchpad builderror - Can't locate Debian/Debhelper/Sequence/python3.pm

  20. 20

    phpmyadmin is working fine but I can't find config.inc.php file?

  21. 21

    I Can't Find dompdf_config.inc.php or dompdf_config.custom.inc.php for setting "DOMPDF_UNICODE_ENABLED" true

  22. 22

    I Can't Find dompdf_config.inc.php or dompdf_config.custom.inc.php for setting "DOMPDF_UNICODE_ENABLED" true

  23. 23

    Can't locate LWP

  24. 24

    Perl can't locate object method "query_form" via package "URI::_foreign" at Geo::Coder::Google::V3.pm

  25. 25

    Selenium can't locate this element

  26. 26

    Can't locate ImageIcon in JButton

  27. 27

    Can't locate checkbox in webform

  28. 28

    Can't locate path: <0>

  29. 29

    Can't locate the GET request

HotTag

Archive