Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
PerlMonks  

Re: lib pragma and module installation

by gnat (Beadle)
on Sep 02, 2000 at 04:31 UTC ( [id://30837]=note: print w/replies, xml ) Need Help??


in reply to lib pragma and module installation

PREFIX is when you're built your own complete installation of Perl and installed it there. LIB is probably what the questioner wants.

You have the steps incomplete, though:

mkdir ~/src cd ~/src (download DBI-1.blahblah.tar.gz) tar xzf DBI-1.blahblah.tar.gz cd DBI-1.blahblahblah perl Makefile.PL LIB=~/myperl make make test make install
I'm keeping the source code to the DBI module in one place (~/src) and the installed version in another (~/myperl). Always a good idea.

Then put this at the top of your program that uses the DBI module:

use lib "/usr/home/sz/myperl"; use DBI;
and it should load the DBI library from that directory.

If you have different versions of Perl all over the place, you might have to say:

/pkg/perl5/plus/bin/perl Makefile.PL LIB=~/myperl
To specify which version of Perl the module is being built for. This would be the same version of Perl that you put at the top of your programs:
#!/pkg/perl5plus/bin/perl -w
Hope this helps you!

Nat

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://30837]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others exploiting the Monastery: (9)
As of 2024-04-19 07:56 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found