Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

@NIC include path #3

Closed
gdruce opened this issue Sep 27, 2010 · 1 comment
Closed

@NIC include path #3

gdruce opened this issue Sep 27, 2010 · 1 comment

Comments

@gdruce
Copy link

gdruce commented Sep 27, 2010

Could be a local config issue but straight out of the download I found the code had problems finding the library files.
eg errors like

Can't locate AlarmDaemon/Controller.pm in @INC (@INC contains: .....

Easiest way for me to work around it, was to add the local lib path via the following line at the top of each file.

#add a local path to lib
use lib './lib'; 
@nickandrew
Copy link
Owner

The correct response is to execute this command before running any daemon or script:

export PERLLIB=./lib

That takes care of finding modules when your current directory is the top directory of the repository. If you do instead:

export PERLLIB=$PWD/lib

then you can move around the filesystem afterward and the code will still work.

The reason to use $PERLLIB instead of 'use lib' is the code shouldn't contain any assumptions about which directory it is installed in. If the LS30 code is packaged then the modules would be installed under /usr/share/perl5 which is a standard location for perl to find modules and neither $PERLLIB nor 'use lib' would be required.

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants