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
at webcnp_lib.pl line 30.
/var/www/cgi-bin (empty dir)
/var/www/html (empty dir)
/var/www/perl (the config file is located in this directory)
/var/www/ssi (all the .pl files for the app are located here, including all the JS and CSS files)
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
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.