Home     |     .Net Programming    |     cSharp Home    |     Sql Server Home    |     Javascript / Client Side Development     |     Ajax Programming

Ruby on Rails Development     |     Perl Programming     |     C Programming Language     |     C++ Programming     |     IT Jobs

Python Programming Language     |     Laptop Suggestions?    |     TCL Scripting     |     Fortran Programming     |     Scheme Programming Language


 
 
Cervo Technologies
The Right Source to Outsource

MS Dynamics CRM 3.0

Perl Programming Language

FAQ 8.47 How do I keep my own module/library directory?


This is an excerpt from the latest version perlfaq8.pod, which
comes with the standard Perl distribution. These postings aim to
reduce the number of repeated questions as well as allow the community
to review and update the answers. The latest version of the complete
perlfaq is at http://faq.perl.org .

--------------------------------------------------------------------

8.47: How do I keep my own module/library directory?

    When you build modules, use the PREFIX and LIB options when generating
    Makefiles:

            perl Makefile.PL PREFIX=/mydir/perl LIB=/mydir/perl/lib

    then either set the PERL5LIB environment variable before you run scripts
    that use the modules/libraries (see perlrun) or say

            use lib '/mydir/perl/lib';

    This is almost the same as

            BEGIN {
            unshift(@INC, '/mydir/perl/lib');
            }

    except that the lib module checks for machine-dependent subdirectories.
    See Perl's lib for more information.

--------------------------------------------------------------------

The perlfaq-workers, a group of volunteers, maintain the perlfaq. They
are not necessarily experts in every domain where Perl might show up,
so please include as much information as possible and relevant in any
corrections. The perlfaq-workers also don't have access to every
operating system or platform, so please include relevant details for
corrections to examples that do not work on particular platforms.
Working code is greatly appreciated.

If you'd like to help maintain the perlfaq, see the details in
perlfaq.pod.

--
Posted via a free Usenet account from http://www.teranews.com

In article <6pqaj4-tn8.@blue.stonehenge.com>, PerlFAQ Server

How about adding something for CPAN shell users? Something like:

     If you use the CPAN module for building and installing modules,
     start the shell and enter the following:

         cpan> o conf makepl_arg PREFIX=/mydir/perl,LIB=/mydir/perl/lib
         cpan> o conf commit

 Posted Via Usenet.com Premium Usenet Newsgroup Services
----------------------------------------------------------
    ** SPEED ** RETENTION ** COMPLETION ** ANONYMITY **
----------------------------------------------------------        
                http://www.usenet.com

On Jun 4, 1:01 pm, Jim Gibson <jgib@mail.arc.nasa.gov> wrote:

> In article <6pqaj4-tn8.@blue.stonehenge.com>, PerlFAQ Server
> wrote:
> > 8.47: How do I keep my own module/library directory?
> How about adding something for CPAN shell users? Something like:

>  If you use the CPAN module for building and installing
>  modules, start the shell and enter the following:

>   cpan> o conf makepl_arg PREFIX=/mydir/perl,LIB=/mydir/perl/lib
>   cpan> o conf commit

There should also be something in this FAQ for modules that use
Module::Build's Build.PL rather than ExtUtils::MakeMaker's
Makefile.PL.  IIRC, the flag is --install_base, and the CPAN option
(for relatively recent releases of CPAN.pm) is mbuildpl_arg.

Paul Lalli

On Mon, 04 Jun 2007 10:01:21 -0700 Jim Gibson <jgib@mail.arc.nasa.gov> wrote:

JG> How about adding something for CPAN shell users? Something like:

JG>      If you use the CPAN module for building and installing modules,
JG>      start the shell and enter the following:

cpan> o conf makepl_arg PREFIX=/mydir/perl,LIB=/mydir/perl/lib
cpan> o conf commit

Seconded, that's very useful.

Ted

In article <040620071001218902%jgib@mail.arc.nasa.gov>, Jim Gibson

<jgib@mail.arc.nasa.gov> wrote:
> In article <6pqaj4-tn8.@blue.stonehenge.com>, PerlFAQ Server
> <b@stonehenge.com> wrote:

> > --------------------------------------------------------------------

> > 8.47: How do I keep my own module/library directory?
> How about adding something for CPAN shell users? Something like:

How about this?

--------------------
=head2 How do I keep my own module/library directory?

When you build modules, tell Perl where to install the modules.

For C<Makefile.PL>-based distributions, use the PREFIX and LIB options
when generating Makefiles:

   perl Makefile.PL PREFIX=/mydir/perl LIB=/mydir/perl/lib

You can set this in your CPAN.pm configuration so modules automatically
install
in your private library directory when you use the CPAN.pm shell:

   % cpan
   cpan> o conf makepl_arg PREFIX=/mydir/perl,LIB=/mydir/perl/lib
   cpan> o conf commit

For C<Build.PL>-based distributions, use the --install_base option:

   perl Build.PL --install_base /mydir/perl

You can configure CPAN.pm to automatically use this option too:

   % cpan
   cpan> o conf mbuild_arg --install_base /mydir/perl
   cpan> o conf commit

--
Posted via a free Usenet account from http://www.teranews.com

Add to del.icio.us | Digg this | Stumble it | Powered by Megasolutions Inc