Install module into a nonstandard place

N

news.hinet.net

OS:Reahat 9 perl 5.8.0 (net::ldap in /usr/local/modftp/perl-ldap-0.3202)


cd /usr/local/modftp/perl-ldap-0.3202
perl Makefile.PL LIB=/usr/local/modftp/perlmod
PREFIX=/usr/local/modftp/perlmod
make
make install

(The module install is success...)

write some code to testing

#!/usr/local/bin/perl
use lib 'usr/local/modftp/perlmod';
use Net::LDAP;

will print error message

"LDAP_SUCCESS" is not exported by the Net::LDAP::Constant module at
/usr/local/modftp/perlmod/Net/LDAP/Message.pm line 7
"LDAP_COMPARE_TRUE" is not exported by the Net::LDAP::Constant module at
/usr/local/modftp/perlmod/Net/LDAP/Message.pm line 7
"LDAP_COMPARE_FALSE" is not exported by the Net::LDAP::Constant module at
/usr/local/modftp/perlmod/Net/LDAP/Message.pm line 7
Can't continue after import errors at
/usr/local/modftp/perlmod/Net/LDAP/Message.pm line 7
BEGIN failed--compilation aborted at
/usr/local/modftp/perlmod/Net/LDAP/Message.pm line 7, <DATA> line 1.
Compilation failed in require at /usr/local/modftp/perlmod/Net/LDAP.pm line
13, <DATA> line 1.
BEGIN failed--compilation aborted at /usr/local/modftp/perlmod/Net/LDAP.pm
line 13, <DATA> line 1.
Compilation failed in require at ldaptest.pl line 6, <DATA> line 1.
BEGIN failed--compilation aborted at ldaptest.pl line 6, <DATA> line 1.

And i use the same config to install other module(POE DBI Net::SOAP
IPC::ShareLite.....) is ok.
And i use the same config to install to solaris is ok.
 
M

Mladen Gogala

cd /usr/local/modftp/perl-ldap-0.3202
perl Makefile.PL LIB=/usr/local/modftp/perlmod
PREFIX=/usr/local/modftp/perlmod

This should read:

cd /usr/local/modftp/perl-ldap-0.3202
perl Makefile.PL perfix=/usr/local/modftp/perlmod

Then, of course, you should set and export shell variable PERL5LIB
to point to the directory where the .pm file actually resides.

Sretno, i dobra zabava.
 
N

news.hinet.net

I try to setenv PERLLIB & PERL5LIB. but it have the same error
message.(net::ldap)
And other module use the same config not to setenv.It still can run.
 
M

Mladen Gogala

I try to setenv PERLLIB & PERL5LIB. but it have the same error
message.(net::ldap)
And other module use the same config not to setenv.It still can run.

OK. I will not install LDAP, because I don't want to download gazillion
other modules from CPAN, but let's try with Net::DNS:
$ mkdir ~/my_mods
$ ls
Changes demo lib MANIFEST README TODO
contrib DNS.xs Makefile.PL META.yml t
$ perl Makefile.PL prefix=$HOME/my_mods
Testing if you have a C compiler and the needed header files....
cc -c -o compile.o compile.c
You have a working compiler.

You appear to be directly connected to the Internet. I have some tests
that try to query live nameservers.

Do you want to enable these tests? [y]
Checking if your kit is complete...
Looks good
Writing Makefile for Net::DNS

Make and make test go more or less as expected, below is the output from
make install:
$ make install
Installing /home/mgogala/my_mods/lib/perl5/site_perl/5.8.0/i386-linux-thread-multi/auto/Net/DNS/DNS.so
Installing /home/mgogala/my_mods/lib/perl5/site_perl/5.8.0/i386-linux-thread-multi/auto/Net/DNS/DNS.bs
Files found in blib/arch: installing files in blib/lib into architecture dependent library tree
Installing /home/mgogala/my_mods/lib/perl5/site_perl/5.8.0/i386-linux-thread-multi/Net/DNS.pm
Installing /home/mgogala/my_mods/lib/perl5/site_perl/5.8.0/i386-linux-thread-multi/Net/DNS/Header.pm
Installing /home/mgogala/my_mods/lib/perl5/site_perl/5.8.0/i386-linux-thread-multi/Net/DNS/Update.pm
Installing /home/mgogala/my_mods/lib/perl5/site_perl/5.8.0/i386-linux-thread-multi/Net/DNS/Resolver.pm
Installing /home/mgogala/my_mods/lib/perl5/site_perl/5.8.0/i386-linux-thread-multi/Net/DNS/Nameserver.pm
Installing /home/mgogala/my_mods/lib/perl5/site_perl/5.8.0/i386-linux-thread-multi/Net/DNS/FAQ.pod
Installing /home/mgogala/my_mods/lib/perl5/site_perl/5.8.0/i386-linux-thread-multi/Net/DNS/Question.pm
Installing /home/mgogala/my_mods/lib/perl5/site_perl/5.8.0/i386-linux-thread-multi/Net/DNS/Packet.pm
Installing /home/mgogala/my_mods/lib/perl5/site_perl/5.8.0/i386-linux-thread-multi/Net/DNS/RR.pm
Installing /home/mgogala/my_mods/lib/perl5/site_perl/5.8.0/i386-linux-thread-multi/Net/DNS/Resolver/Win32.pm
Installing /home/mgogala/my_mods/lib/perl5/site_perl/5.8.0/i386-linux-thread-multi/Net/DNS/Resolver/Cygwin.pm
Installing /home/mgogala/my_mods/lib/perl5/site_perl/5.8.0/i386-linux-thread-multi/Net/DNS/Resolver/Recurse.pm
Installing /home/mgogala/my_mods/lib/perl5/site_perl/5.8.0/i386-linux-thread-multi/Net/DNS/Resolver/UNIX.pm
Installing /home/mgogala/my_mods/lib/perl5/site_perl/5.8.0/i386-linux-thread-multi/Net/DNS/Resolver/Base.pm
Installing /home/mgogala/my_mods/lib/perl5/site_perl/5.8.0/i386-linux-thread-multi/Net/DNS/RR/A.pm
Installing /home/mgogala/my_mods/lib/perl5/site_perl/5.8.0/i386-linux-thread-multi/Net/DNS/RR/Unknown.pm
Installing /home/mgogala/my_mods/lib/perl5/site_perl/5.8.0/i386-linux-thread-multi/Net/DNS/RR/MX.pm
Installing /home/mgogala/my_mods/lib/perl5/site_perl/5.8.0/i386-linux-thread-multi/Net/DNS/RR/EID.pm
Installing /home/mgogala/my_mods/lib/perl5/site_perl/5.8.0/i386-linux-thread-multi/Net/DNS/RR/ISDN.pm
Installing /home/mgogala/my_mods/lib/perl5/site_perl/5.8.0/i386-linux-thread-multi/Net/DNS/RR/NIMLOC.pm
Installing /home/mgogala/my_mods/lib/perl5/site_perl/5.8.0/i386-linux-thread-multi/Net/DNS/RR/SOA.pm
Installing /home/mgogala/my_mods/lib/perl5/site_perl/5.8.0/i386-linux-thread-multi/Net/DNS/RR/OPT.pm
Installing /home/mgogala/my_mods/lib/perl5/site_perl/5.8.0/i386-linux-thread-multi/Net/DNS/RR/TXT.pm
Installing /home/mgogala/my_mods/lib/perl5/site_perl/5.8.0/i386-linux-thread-multi/Net/DNS/RR/DNAME.pm
Installing /home/mgogala/my_mods/lib/perl5/site_perl/5.8.0/i386-linux-thread-multi/Net/DNS/RR/AAAA.pm
Installing /home/mgogala/my_mods/lib/perl5/site_perl/5.8.0/i386-linux-thread-multi/Net/DNS/RR/RP.pm
Installing /home/mgogala/my_mods/lib/perl5/site_perl/5.8.0/i386-linux-thread-multi/Net/DNS/RR/X25.pm
Installing /home/mgogala/my_mods/lib/perl5/site_perl/5.8.0/i386-linux-thread-multi/Net/DNS/RR/PTR.pm
Installing /home/mgogala/my_mods/lib/perl5/site_perl/5.8.0/i386-linux-thread-multi/Net/DNS/RR/NS.pm
Installing /home/mgogala/my_mods/lib/perl5/site_perl/5.8.0/i386-linux-thread-multi/Net/DNS/RR/TSIG.pm
Installing /home/mgogala/my_mods/lib/perl5/site_perl/5.8.0/i386-linux-thread-multi/Net/DNS/RR/PX.pm
Installing /home/mgogala/my_mods/lib/perl5/site_perl/5.8.0/i386-linux-thread-multi/Net/DNS/RR/LOC.pm
Installing /home/mgogala/my_mods/lib/perl5/site_perl/5.8.0/i386-linux-thread-multi/Net/DNS/RR/NULL.pm
Installing /home/mgogala/my_mods/lib/perl5/site_perl/5.8.0/i386-linux-thread-multi/Net/DNS/RR/RT.pm
Installing /home/mgogala/my_mods/lib/perl5/site_perl/5.8.0/i386-linux-thread-multi/Net/DNS/RR/AFSDB.pm
Installing /home/mgogala/my_mods/lib/perl5/site_perl/5.8.0/i386-linux-thread-multi/Net/DNS/RR/SRV.pm
Installing /home/mgogala/my_mods/lib/perl5/site_perl/5.8.0/i386-linux-thread-multi/Net/DNS/RR/MINFO.pm
Installing /home/mgogala/my_mods/lib/perl5/site_perl/5.8.0/i386-linux-thread-multi/Net/DNS/RR/MR.pm
Installing /home/mgogala/my_mods/lib/perl5/site_perl/5.8.0/i386-linux-thread-multi/Net/DNS/RR/CNAME.pm
Installing /home/mgogala/my_mods/lib/perl5/site_perl/5.8.0/i386-linux-thread-multi/Net/DNS/RR/HINFO.pm
Installing /home/mgogala/my_mods/lib/perl5/site_perl/5.8.0/i386-linux-thread-multi/Net/DNS/RR/NAPTR.pm
Installing /home/mgogala/my_mods/lib/perl5/site_perl/5.8.0/i386-linux-thread-multi/Net/DNS/RR/CERT.pm
Installing /home/mgogala/my_mods/lib/perl5/site_perl/5.8.0/i386-linux-thread-multi/Net/DNS/RR/MG.pm
Installing /home/mgogala/my_mods/lib/perl5/site_perl/5.8.0/i386-linux-thread-multi/Net/DNS/RR/TKEY.pm
Installing /home/mgogala/my_mods/lib/perl5/site_perl/5.8.0/i386-linux-thread-multi/Net/DNS/RR/NSAP.pm
Installing /home/mgogala/my_mods/lib/perl5/site_perl/5.8.0/i386-linux-thread-multi/Net/DNS/RR/MB.pm
Installing /home/mgogala/my_mods/share/man/man3/Net::DNS::RR::A.3pm
Installing /home/mgogala/my_mods/share/man/man3/Net::DNS::Resolver::Win32.3pm
Installing /home/mgogala/my_mods/share/man/man3/Net::DNS::RR::Unknown.3pm
Installing /home/mgogala/my_mods/share/man/man3/Net::DNS::RR::EID.3pm
Installing /home/mgogala/my_mods/share/man/man3/Net::DNS::RR::ISDN.3pm
Installing /home/mgogala/my_mods/share/man/man3/Net::DNS::RR::MX.3pm
Installing /home/mgogala/my_mods/share/man/man3/Net::DNS::Header.3pm
Installing /home/mgogala/my_mods/share/man/man3/Net::DNS::RR::SOA.3pm
Installing /home/mgogala/my_mods/share/man/man3/Net::DNS::RR::OPT.3pm
Installing /home/mgogala/my_mods/share/man/man3/Net::DNS::RR::NIMLOC.3pm
Installing /home/mgogala/my_mods/share/man/man3/Net::DNS::RR::DNAME.3pm
Installing /home/mgogala/my_mods/share/man/man3/Net::DNS::RR::TXT.3pm
Installing /home/mgogala/my_mods/share/man/man3/Net::DNS::RR::AAAA.3pm
Installing /home/mgogala/my_mods/share/man/man3/Net::DNS.3pm
Installing /home/mgogala/my_mods/share/man/man3/Net::DNS::RR::X25.3pm
Installing /home/mgogala/my_mods/share/man/man3/Net::DNS::RR::RP.3pm
Installing /home/mgogala/my_mods/share/man/man3/Net::DNS::RR::pTR.3pm
Installing /home/mgogala/my_mods/share/man/man3/Net::DNS::Resolver::Recurse.3pm
Installing /home/mgogala/my_mods/share/man/man3/Net::DNS::Resolver::Cygwin.3pm
Installing /home/mgogala/my_mods/share/man/man3/Net::DNS::RR::NS.3pm
Installing /home/mgogala/my_mods/share/man/man3/Net::DNS::RR::TSIG.3pm
Installing /home/mgogala/my_mods/share/man/man3/Net::DNS::Update.3pm
Installing /home/mgogala/my_mods/share/man/man3/Net::DNS::Resolver.3pm
Installing /home/mgogala/my_mods/share/man/man3/Net::DNS::RR::pX.3pm
Installing /home/mgogala/my_mods/share/man/man3/Net::DNS::Nameserver.3pm
Installing /home/mgogala/my_mods/share/man/man3/Net::DNS::RR::NULL.3pm
Installing /home/mgogala/my_mods/share/man/man3/Net::DNS::RR::LOC.3pm
Installing /home/mgogala/my_mods/share/man/man3/Net::DNS::RR::SRV.3pm
Installing /home/mgogala/my_mods/share/man/man3/Net::DNS::RR::AFSDB.3pm
Installing /home/mgogala/my_mods/share/man/man3/Net::DNS::RR::RT.3pm
Installing /home/mgogala/my_mods/share/man/man3/Net::DNS::RR::MINFO.3pm
Installing /home/mgogala/my_mods/share/man/man3/Net::DNS::RR::MR.3pm
Installing /home/mgogala/my_mods/share/man/man3/Net::DNS::FAQ.3pm
Installing /home/mgogala/my_mods/share/man/man3/Net::DNS::RR::CNAME.3pm
Installing /home/mgogala/my_mods/share/man/man3/Net::DNS::Question.3pm
Installing /home/mgogala/my_mods/share/man/man3/Net::DNS::RR::NAPTR.3pm
Installing /home/mgogala/my_mods/share/man/man3/Net::DNS::RR.3pm
Installing /home/mgogala/my_mods/share/man/man3/Net::DNS::packet.3pm
Installing /home/mgogala/my_mods/share/man/man3/Net::DNS::RR::HINFO.3pm
Installing /home/mgogala/my_mods/share/man/man3/Net::DNS::RR::MG.3pm
Installing /home/mgogala/my_mods/share/man/man3/Net::DNS::RR::TKEY.3pm
Installing /home/mgogala/my_mods/share/man/man3/Net::DNS::RR::NSAP.3pm
Installing /home/mgogala/my_mods/share/man/man3/Net::DNS::RR::CERT.3pm
Installing /home/mgogala/my_mods/share/man/man3/Net::DNS::Resolver::UNIX.3pm
Installing /home/mgogala/my_mods/share/man/man3/Net::DNS::RR::MB.3pm
Installing /home/mgogala/my_mods/share/man/man3/Net::DNS::Resolver::Base.3pm
Writing /home/mgogala/my_mods/lib/perl5/site_perl/5.8.0/i386-linux-thread-multi/auto/Net/DNS/.packlist
Appending installation info to /home/mgogala/my_mods/lib/perl5/5.8.0/i386-linux-thread-multi/perllocal.pod

Without the proper PERL5LIB setting:
$ perl -e 'use Net::DNS;print Net::DNS->version,"\n";'
0.23
$
With the proper PERL5LIB setting:

PERL5LIB=/home/mgogala/my_mods/lib/perl5/site_perl/5.8.0/i386-linux-thread-multi:$PERL5LIB
$ perl -e 'use Net::DNS;print Net::DNS->version,"\n";'
0.47
$

That means that perl is using my newly installed Net::DNS module version
0.47 which is newer then version 0.23 which comes with the system.
Try locating the .pm file for the module you're looking for with find
and then put the coresponding directory in the PERL5LIB.
 
M

Mladen Gogala

Or even better, tell perl where are your libraries,
use lib qw(all my extra pm dirs);

This can cause program to fail, if moved to another box,
but it is a viable option.
Nije ti on s Hineta ako si na to mislio. :)

Jesam, zaista.
 
M

Matija Papec

X-Ftn-To: Mladen Gogala

Mladen Gogala said:
This can cause program to fail, if moved to another box,
but it is a viable option.

Yes, but one should be fine as long as it sticks to relative paths.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,768
Messages
2,569,575
Members
45,053
Latest member
billing-software

Latest Threads

Top