Beefy Boxes and Bandwidth Generously Provided by pair Networks Joe
more useful options
 
PerlMonks

Set Install path in CPAN

by rose (Beadle)
 | Log in | Create a new user | The Monastery Gates | Super Search | 
 | Seekers of Perl Wisdom | Meditations | PerlMonks Discussion | 
 | Obfuscation | Reviews | Cool Uses For Perl | Perl News | Q&A | Tutorials | 
 | Poetry | Recent Threads | Newest Nodes | Donate | What's New | 

on Aug 01, 2007 at 11:50 UTC ( #630026=perlquestion: print w/ replies, xml ) Need Help??
rose has asked for the wisdom of the Perl Monks concerning the following question:

We are using cpan command in unix environment to install the perl modules.

cpan> install HTML::Template

This modules will install in @INC path.

I want to install HTML::Template module in my personal directory ie. /proj/rose/.

Is there any way to set installation path?

Thanks in Advance!!
Rose

Comment on Set Install path in CPAN
Select or Download Code
Re: Set Install path in CPAN
by lima1 (Deacon) on Aug 01, 2007 at 11:58 UTC
    cpan> o conf mbuildpl_arg "--install_base /proj/rose/" cpan> o conf makepl_arg "PREFIX=/proj/rose/" cpan> install HTML::Template
Re: Set Install path in CPAN
by gube (Parson) on Aug 01, 2007 at 12:13 UTC
Re: Set Install path in CPAN
by trwww (Hermit) on Aug 01, 2007 at 13:57 UTC

    When the CPAN shell starts, if it finds a file called ~/.cpan/CPAN/MyConfig.pm it will use that as the configuration file instead of the default one root has in its home directory.

    So, run:

    $ mkdir -p ~/.cpan/CPAN

    and then run:

    $ cp /root/.cpan/CPAN/Config.pm ~/.cpan/CPAN/MyConfig.pm

    or even just:

    $ touch ~/.cpan/CPAN/MyConfig.pm

    Now, when you run:

    $ perl -MCPAN -e shell

    At the cpan prompt tell it to initialize the configuration:

    cpan> o conf init

    CPAN will go through its initialization process, and ask you a bunch of questions (including what to set as arguments to Makefile.PL, which tells make install where to put the files. When it is done, you can use the cpan shell to install modules in a user defined location.

    Note that when installing libraries that have dependencies that are installed in your local directory, perl needs to be able to find them. So what I do is set PERL5LIB when I run cpan:

    $ PERL5LIB=~/perl/lib perl -MCPAN -e shell

    Enjoy,

    trwww

Login:
Password
remember me
What's my password?
Create A New User

Node Status?
node history
Node Type: perlquestion [id://630026]
Approved by lima1
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others contemplating the Monastery: (17)
shmem
toolic
holli
Gavin
CardinalNumber
jethro
kennethk
thezip
Eyck
Perlbotics
LanX
crashtest
ssandv
MikeDexter
ReturnOfThelonious
TerribleD
im2
As of 2010-02-09 22:10 GMT
Sections?
The Monastery Gates
Seekers of Perl Wisdom
Meditations
PerlMonks Discussion
Categorized Q&A
Tutorials
Obfuscated Code
Perl Poetry
Cool Uses for Perl
Perl News
Information?
PerlMonks FAQ
Guide to the Monastery
What's New at PerlMonks
Voting/Experience System
Tutorials
Reviews
Library
Perl FAQs
Other Info Sources
Find Nodes?
Nodes You Wrote
Super Search
List Nodes By Users
Newest Nodes
Recently Active Threads
Selected Best Nodes
Best Nodes
Worst Nodes
Saints in our Book
Leftovers?
The St. Larry Wall Shrine
Offering Plate
Awards
Craft
Snippets Section
Code Catacombs
Quests
Editor Requests
Buy PerlMonks Gear
PerlMonks Merchandise
Planet Perl
Perlsphere
Use Perl
Perl.com
Perl 5 Wiki
Perl Jobs
Perl Mongers
Perl Directory
Perl documentation
CPAN
Random Node
Voting Booth?

What level of existential comfort do you require?

Palace
Executive suite at the best hotel
Regular hotel in a decent part of town
Motel
Boarding house
Sleeping Bag on Couch in Basement
Any port in a storm
Camping under the freeway overpass
Jail
Other

Results (283 votes), past polls