I did that and still when running the scripts, references to the site_perl libraries.
Main Topics
Browse All TopicsHi,
I have a set of libraries duplicated in the site_perl and vendor_perl directory. The ones I want to use are in vendor_perl (installed with an rpm) but perl seems to be using the site_perl ones... What is the difference between the 2? what is the impact of moving the vendor_perl ones to site_perl?
Thanks,
PJ
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
I removed the perl_site library and made sure that the path to perl_site was in @INC, but I get and error stating that there isn't a loadable object for modeule NetSNMP::default_store
Can't locate loadable object for module NetSNMP::default_store in @INC (@INC contains: /usr/lib/perl5/site_perl/5
Compilation failed in require at /usr/lib/perl5/site_perl/5
BEGIN failed--compilation aborted at /usr/lib/perl5/site_perl/5
Compilation failed in require at /shaw/neteye/perl_scripts/
BEGIN failed--compilation aborted at /shaw/neteye/perl_scripts/
The module exists tho:
$ ls -l /usr/lib/perl5/vendor_perl
total 52
drwxr-xr-x 2 root root 4096 Jun 22 17:50 agent
-r--r--r-- 1 root root 13194 Jun 30 2006 agent.pm
-r--r--r-- 1 root root 2877 Jun 30 2006 ASN.pm
-r--r--r-- 1 root root 9295 Jun 30 2006 default_store.pm
-r--r--r-- 1 root root 5344 Jun 30 2006 OID.pm
-r--r--r-- 1 root root 7335 Jun 30 2006 TrapReceiver.pm
And:
/usr/lib/perl5/vendor_perl
>>I removed the perl_site library and made sure that the path to perl_site was in @INC
What did you remove? The entire directory? Did you remove it from @INC, or from the file system?
Perl will search @INC in the order specified to look for any modules. If you want a particular directory to be search first, it needs to be higher in the @INC. You don't need to remove files from the filesystem.
To change @INC:
1) Use the PERL5LIB environment variable
2) Use the -I command line option
3) Use the "use lib" statement in your code
Hi Adam314,
#3, Do you mean I should use 'use lib /path/to/lib' when doing the include?
I've been trying to avoid that if it's the case. I don't want to make the script dependent on this environment setup.
yes, I removed the files from teh system, but it seems like perl is refusing to use the other library:
"Can't locate loadable object for module NetSNMP::default_store in @INC "
Even though the path to this module is in @INC.
Why? :(
PJ
For #3: Yes, you would add a "use lib /path/to/lib;" statement to your script. The script would be dependent on this setup though.
Perl will use the module in the first directory of @INC that it finds the module. If you've removed it from one directory and it's not working, then I'm guessing either:
1) some part of the module is still in the first directory, but not all of it - which is causing the problem
2) No part of the module is in the first directory, but all parts are not in the second directory.
For problem 1 - you would need to remove all pieces of the module, including the autoload files.
For problem 2 - Install the module by following the module's installation guide (typically make;make test;make install)
Hi Adam314,
Thanks for your reply, these and the others to my previous questions have been very helpful.
I used an rpm to install the module, that's what got installed in perl_vendor but the other one is not owned by any package, so I just removed the folder that contained the module but I'm not sure if there is more that I need to clean up.
Could you please let me know what other directories/files I should be removing?
Thanks,
PJ
For a module, there is going to be a main .pm file, then possibly a directory with other files, and possibly a directory in auto with more files.
So, for Some::Module, you need to remove:
$lib/Some/Module.pm
$lib/Some/Module/
$lib/auto/Some/Module/
Where $lib is your library directory. Those ending with a slash / indicate a directory.
Business Accounts
Answer for Membership
by: SmartIntelPosted on 2009-06-22 at 18:27:45ID: 24688177
you can indicate which directory to use by
use lib '/path/to/vender_dir';