accessing NEW modules when you don't have privs

M

Mark Seger

I find myself on a system with no privs trying to build a pm that links
into an object module with swig - very cool tool. Therefore I can't
'make install'. Naturally when I try to 'use' it the load fails. I've
gotta believe this has come up before and there is some 'trick' but I
just don't know enough about the subtleties of module loading, to know
what it is. Can someone help?

-mark
 
A

A. Sinan Unur

Mark Seger said:
I find myself on a system with no privs trying to build a pm that links
into an object module with swig - very cool tool. Therefore I can't
'make install'. Naturally when I try to 'use' it the load fails. I've
gotta believe this has come up before and there is some 'trick' but I
just don't know enough about the subtleties of module loading, to know
what it is. Can someone help?

perldoc -q lib
 
T

Tad McClellan

Mark Seger said:
I've
gotta believe this has come up before


Questions that are Asked Frequently, along with their answers,
are compiled into documents known as "FAQ"s in a futile attempt
to prevent them from being asked yet again (but that never works).

You are expected to check the Perl FAQ *before* posting to
the Perl newsgroup.


perldoc -q module

How do I install a module from CPAN?

How do I keep my own module/library directory?
 
M

Mark Seger

I find myself on a system with no privs trying to build a pm that links
perldoc -q lib
wow, that's great. I guess one of my problems is there's so much
documentation that half the battle is knowing where to look. In any
event, I'm still having problems.

I did my Makefile.PL using PREFIX=/usr2/seger/IBperl/perllib, which is
where I wanted the modules to be in stall and sure enough, when I did my
make install that's where it ended up. My module is called GetPctr.pm:

ibdln66> find /usr2/seger/IBperl/ -name GetPctr.pm -print
/usr2/seger/IBperl/blib/lib/GetPctr.pm
/usr2/seger/IBperl/GetPctr.pm
/usr2/seger/IBperl/perllib/lib64/perl5/site_perl/5.8.0/GetPctr.pm

So then I built a simple test script that looks like this:

#!/usr/bin/perl -w
use lib '/usr2/seger/IBperl/perllib';
use GetPctr;

did I misunderstant the perldoc? when I run it I get the typical:

ibdln66> ./test.pl
Can't locate loadable object for module GetPctr in @INC (@INC contains:
/usr2/seger/IBperl/perllib
/usr/lib64/perl5/5.8.0/x86_64-linux-thread-multi /usr/lib/perl5/5.8.0
/usr/lib64/perl5/site_perl/5.8.0 /usr/lib/perl5/site_perl/5.8.0
/usr/lib/perl5/site_perl
/usr/lib64/perl5/vendor_perl/5.8.0/x86_64-linux-thread-multi
/usr/lib/perl5/vendor_perl/5.8.0 /usr/lib/perl5/vendor_perl .) at
GetPctr.pm line 7
Compilation failed in require at ./test.pl line 4.
BEGIN failed--compilation aborted at ./test.pl line 4.

but I'm sooo close it hurts....

-mark
 
M

Mark Seger

#!/usr/bin/perl -w
use lib '/usr2/seger/IBperl/perllib';
use GetPctr;

did I misunderstant the perldoc? when I run it I get the typical:

ibdln66> ./test.pl
Can't locate loadable object for module GetPctr in @INC (@INC contains:
/usr2/seger/IBperl/perllib
/usr/lib64/perl5/5.8.0/x86_64-linux-thread-multi /usr/lib/perl5/5.8.0
/usr/lib64/perl5/site_perl/5.8.0 /usr/lib/perl5/site_perl/5.8.0
/usr/lib/perl5/site_perl
/usr/lib64/perl5/vendor_perl/5.8.0/x86_64-linux-thread-multi
/usr/lib/perl5/vendor_perl/5.8.0 /usr/lib/perl5/vendor_perl .) at
GetPctr.pm line 7
Compilation failed in require at ./test.pl line 4.
BEGIN failed--compilation aborted at ./test.pl line 4.

Wait - I found the problem! I needed to do a

use lib '/usr2/seger/IBperl/perllib/lib64/perl5/site_perl/5.8.0/';

I guess I'd claim there is a bug in the documentation because it implied
(at least to me) that you use the same directory in 'use lib' as you use
in the PREFIX switch to Makefile.PL.

-mark
 
G

Gunnar Hjalmarsson

A. Sinan Unur said:
perldoc -q lib

That FAQ entry does presuppose that you can run 'make install', doesn't it?

Now, even if it proved that the OP could in this case, questions about
module installations appears to be one of the most frequent categories
of questions in this group and similar forums. Personally I think that
more extensive advice in the FAQ would be desirable, and that writing it
should be given high priority.

At first hand I'm thinking of users without shell access. The builds
available at ActiveState should be mentioned in the FAQ IMO, and also
how you can make use of pure Perl modules by simply uploading the .pm files.
 

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

Forum statistics

Threads
473,744
Messages
2,569,482
Members
44,901
Latest member
Noble71S45

Latest Threads

Top