2023-10-23 00:01:16 -04:00
<!DOCTYPE html>
< html >
<!-- Created by GNU Texinfo 7.1, https://www.gnu.org/software/texinfo/ -->
2016-10-03 08:05:44 -04:00
< head >
2023-10-23 00:01:16 -04:00
< meta http-equiv = "Content-Type" content = "text/html; charset=utf-8" >
<!-- This manual describes GNU Stow version 2.3.2 - fixbug56727
(23 October 2023), a program for managing farms of symbolic links.
2016-10-03 08:05:44 -04:00
Software and documentation is copyrighted by the following:
2023-10-23 00:01:16 -04:00
© 1993, 1994, 1995, 1996 Bob Glickstein < bobg + stow @ zanshin . com >
© 2000, 2001 Guillaume Morin < gmorin @ gnu . org >
© 2007 Kahlil (Kal) Hodgson < kahlil @ internode . on . net >
© 2011 Adam Spiers < stow @ adamspiers . org >
Permission is granted to make and distribute verbatim copies of this
manual provided the copyright notice and this permission notice are
preserved on all copies.
Permission is granted to copy and distribute modified versions of this
manual under the conditions for verbatim copying, provided also that the
section entitled "GNU General Public License" is included with the
modified manual, and provided that the entire resulting derived work is
distributed under the terms of a permission notice identical to this
one.
Permission is granted to copy and distribute translations of this manual
into another language, under the above conditions for modified versions,
except that this permission notice may be stated in a translation
approved by the Free Software Foundation. -->
< title > Perl and Perl 5 Modules (Stow)< / title >
< meta name = "description" content = "Perl and Perl 5 Modules (Stow)" >
< meta name = "keywords" content = "Perl and Perl 5 Modules (Stow)" >
< meta name = "resource-type" content = "document" >
< meta name = "distribution" content = "global" >
< meta name = "Generator" content = "makeinfo" >
< meta name = "viewport" content = "width=device-width,initial-scale=1" >
< link href = "index.html" rel = "start" title = "Top" >
< link href = "Index.html" rel = "index" title = "Index" >
< link href = "index.html#SEC_Contents" rel = "contents" title = "Table of Contents" >
< link href = "Compile_002dtime-vs-Install_002dtime.html" rel = "up" title = "Compile-time vs Install-time" >
< link href = "Cygnus-Software.html" rel = "prev" title = "Cygnus Software" >
< style type = "text/css" >
<!--
a.copiable-link {visibility: hidden; text-decoration: none; line-height: 0em}
div.example {margin-left: 3.2em}
span.r {font-family: initial; font-weight: normal; font-style: normal}
span:hover a.copiable-link {visibility: visible}
-->
< / style >
2016-10-03 08:05:44 -04:00
< / head >
2023-10-23 00:01:16 -04:00
< body lang = "en" >
< div class = "section-level-extent" id = "Perl-and-Perl-5-Modules" >
< div class = "nav-panel" >
2016-10-03 08:05:44 -04:00
< p >
2023-10-23 00:01:16 -04:00
Previous: < a href = "Cygnus-Software.html" accesskey = "p" rel = "prev" > Cygnus Software< / a > , Up: < a href = "Compile_002dtime-vs-Install_002dtime.html" accesskey = "u" rel = "up" > Compile-time vs Install-time< / a > [< a href = "index.html#SEC_Contents" title = "Table of contents" rel = "contents" > Contents< / a > ][< a href = "Index.html" title = "Index" rel = "index" > Index< / a > ]< / p >
2016-10-03 08:05:44 -04:00
< / div >
2023-10-23 00:01:16 -04:00
< hr >
< h3 class = "section" id = "Perl-and-Perl-5-Modules-1" > < span > 12.5 Perl and Perl 5 Modules< a class = "copiable-link" href = "#Perl-and-Perl-5-Modules-1" > ¶ < / a > < / span > < / h3 >
2016-10-03 08:05:44 -04:00
< p > Perl 4.036 allows you to specify different locations for installation
2023-10-23 00:01:16 -04:00
and for run-time. It is the only widely-used package in this author’ s
2016-10-03 08:05:44 -04:00
experience that allows this, though hopefully more packages will adopt
this model.
2023-10-23 00:01:16 -04:00
< / p >
< p > Unfortunately, the authors of Perl believed that only AFS sites need
2016-10-03 08:05:44 -04:00
this ability. The configuration instructions for Perl 4 misleadingly
state that some occult means are used under AFS to transport files from
their installation tree to their run-time tree. In fact, that confusion
2023-10-23 00:01:16 -04:00
arises from the fact that Depot, Stow’ s predecessor, originated at
Carnegie Mellon University, which was also the birthplace of AFS. CMU’ s
2016-10-03 08:05:44 -04:00
need to separate install-time and run-time trees stemmed from its use of
Depot, not from AFS.
2023-10-23 00:01:16 -04:00
< / p >
< p > The result of this confusion is that Perl 5’ s configuration script
doesn’ t even offer the option of separating install-time and run-time
trees < em class = "emph" > unless< / em > you’ re running AFS. Fortunately, after you’ ve
entered all the configuration settings, Perl’ s setup script gives you
2016-10-03 08:05:44 -04:00
the opportunity to edit those settings in a file called
2023-10-23 00:01:16 -04:00
< samp class = "file" > config.sh< / samp > . When prompted, you should edit this file and replace
2016-10-03 08:05:44 -04:00
occurrences of
2023-10-23 00:01:16 -04:00
< / p >
< div class = "example" >
< pre class = "example-preformatted" > inst< span class = "r" > ...< / span > /usr/local< span class = "r" > ...< / span >
< / pre > < / div >
< p > with
< / p >
< div class = "example" >
< pre class = "example-preformatted" > inst< span class = "r" > ...< / span > /usr/local/stow/perl< span class = "r" > ...< / span >
< / pre > < / div >
< p > You can do this with the following Unix command:
< / p >
< div class = "example" >
< pre class = "example-preformatted" > sed 's,^\(inst.*/usr/local\),\1/stow/perl,' config.sh > config.sh.new
mv config.sh.new config.sh
< / pre > < / div >
< p > Hopefully, the Perl authors will correct this deficiency in Perl 5’ s
2016-10-03 08:05:44 -04:00
configuration mechanism.
2023-10-23 00:01:16 -04:00
< / p >
< p > Perl 5 modules— i.e., extensions to Perl 5— generally conform to a set
2016-10-03 08:05:44 -04:00
of standards for building and installing them. The standard says that
2023-10-23 00:01:16 -04:00
the package comes with a top-level < samp class = "file" > Makefile.PL< / samp > , which is a Perl
script. When it runs, it generates a < samp class = "file" > Makefile< / samp > .
< / p >
< p > If you followed the instructions above for editing < samp class = "file" > config.sh< / samp > when
Perl was built, then when you create a < samp class = "file" > Makefile< / samp > from a
< samp class = "file" > Makefile.PL< / samp > , it will contain separate locations for run-time
(< samp class = "file" > /usr/local< / samp > ) and install-time (< samp class = "file" > /usr/local/stow/perl< / samp > ).
2016-10-03 08:05:44 -04:00
Thus you can do
2023-10-23 00:01:16 -04:00
< / p >
< div class = "example" >
< pre class = "example-preformatted" > perl Makefile.PL
make
make install
< / pre > < / div >
< p > and the files will be installed into < samp class = "file" > /usr/local/stow/perl< / samp > .
2016-10-03 08:05:44 -04:00
However, you might prefer each Perl module to be stowed separately. In
that case, you must edit the resulting Makefile, replacing
2023-10-23 00:01:16 -04:00
< samp class = "file" > /usr/local/stow/perl< / samp > with < samp class = "file" > /usr/local/stow/< var class = "var" > module< / var > < / samp > .
2016-10-03 08:05:44 -04:00
The best way to do this is:
2023-10-23 00:01:16 -04:00
< / p >
< div class = "example" >
< pre class = "example-preformatted" > perl Makefile.PL
find . -name Makefile -print | \
xargs perl -pi~ -e 's,^(INST.*/stow)/perl,$1/< var class = "var" > module< / var > ,;'
make
make install
< / pre > < / div >
< p > (The use of ‘ < samp class = "samp" > find< / samp > ’ and ‘ < samp class = "samp" > xargs< / samp > ’ ensures that all Makefiles in
the module’ s source tree, even those in subdirectories, get edited.) A
2016-10-03 08:05:44 -04:00
good convention to follow is to name the stow directory for a Perl
2023-10-23 00:01:16 -04:00
< var class = "var" > module< / var > < samp class = "file" > cpan.< var class = "var" > module< / var > < / samp > , where ‘ < samp class = "samp" > cpan< / samp > ’ stands for
2016-10-03 08:05:44 -04:00
Comprehensive Perl Archive Network, a collection of FTP sites that is
2023-10-23 00:01:16 -04:00
the source of most Perl 5 extensions. This way, it’ s easy to tell at a
glance which of the subdirectories of < samp class = "file" > /usr/local/stow< / samp > are Perl 5
2016-10-03 08:05:44 -04:00
extensions.
2023-10-23 00:01:16 -04:00
< / p >
< p > When you stow separate Perl 5 modules separately, you are likely to
encounter conflicts (see < a class = "pxref" href = "Conflicts.html" > Conflicts< / a > ) with files named < samp class = "file" > .exists< / samp >
and < samp class = "file" > perllocal.pod< / samp > . One way to work around this is to remove
2016-10-03 08:05:44 -04:00
those files before stowing the module. If you use the
2023-10-23 00:01:16 -04:00
< samp class = "file" > cpan.< var class = "var" > module< / var > < / samp > naming convention, you can simply do this:
< / p >
< div class = "example" >
< pre class = "example-preformatted" > cd /usr/local/stow
find cpan.* \( -name .exists -o -name perllocal.pod \) -print | \
xargs rm
< / pre > < / div >
< / div >
< hr >
< div class = "nav-panel" >
< p >
Previous: < a href = "Cygnus-Software.html" > Cygnus Software< / a > , Up: < a href = "Compile_002dtime-vs-Install_002dtime.html" > Compile-time vs Install-time< / a > [< a href = "index.html#SEC_Contents" title = "Table of contents" rel = "contents" > Contents< / a > ][< a href = "Index.html" title = "Index" rel = "index" > Index< / a > ]< / p >
< / div >
2016-10-03 08:05:44 -04:00
2023-10-23 00:01:16 -04:00
< / body >
< / html >