source: general/prog/perl-alternatives.xml@ 6df794d

perl-modules
Last change on this file since 6df794d was 6df794d, checked in by Ken Moffat <ken@…>, 4 years ago

perl-modules branch: Reduce perl-alternatives.xml to only cover the cpan automated install, and index that under cpan. Add a note to remind me to deal with Data::Uniquid and the unsafe variant of the standard install.

git-svn-id: svn://svn.linuxfromscratch.org/BLFS/branches/perl-modules@20485 af4574ff-66df-0310-9fd7-8a98e5e911e0

  • Property mode set to 100644
File size: 5.2 KB
Line 
1<?xml version="1.0" encoding="ISO-8859-1"?>
2<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
3 "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
4 <!ENTITY % general-entities SYSTEM "../../general.ent">
5 %general-entities;
6
7 <!-- it seems at least one entity is needed -->
8 <!ENTITY perl-alternatives-dummy "42">
9]>
10 <!-- Begin perl alternatives -->
11 <sect2 id="perl-alternatives" xreflabel="CPAN automated install of perl modules">
12
13 <title>CPAN automated install of perl modules</title>
14
15 <indexterm zone="perl-alternatives">
16 <primary sortas="a-cpan-install-of-perl-modules">CPAN automated install of perl modules</primary>
17 </indexterm>
18
19<!--
20 <sect3 role="installation" id="new-perl-standard-install"
21 xreflabel="standard build and installation instructions">
22 <title>Standard Installation of Perl Modules</title>
23
24 <para>Install <application>Perl</application> modules by running the
25 following commands:</para>
26
27 <para>For <xref linkend="perl-data-uniqid"/>, first apply the required
28 patch with:</para>
29
30<screen><userinput>patch -Np1 -i ../Data-Uniqid-&Data-Uniqid-version;-disable_failing_test-1.patch</userinput></screen>
31
32 <para>Then, or for all other modules using the standard installation, proceed
33 with:</para>
34
35<screen><userinput>perl Makefile.PL &amp;&amp;
36make &amp;&amp;
37make test</userinput></screen>
38
39 <note>
40 <para>If the module is described as using the <emphasis>unsafe</emphasis>
41 variant of the Standard Installation, (the use of the current
42 directory in <literal>@INC</literal> was removed for security reasons
43 in <literal>perl-5.26.0</literal>)
44 you should change the perl invocation to:</para>
45
46<screen><userinput>PERL_USE_UNSAFE_INC=1 &amp;&amp;</userinput></screen>
47
48 <para>If, however, you are using the Auto Installation described below,
49 that environment variable will be set whenever the <command>cpan</command>
50 shell <command>install</command> is used.</para>
51 </note>
52
53 <para>Now, as the <systemitem class="username">root</systemitem> user:</para>
54
55<screen role="root"><userinput>make install</userinput></screen>
56
57 <note>
58 <para>When reinstalling a <application>Perl</application> module,
59 sometimes older versions of the module being reinstalled are in other
60 directories specified in <parameter>@INC</parameter>. To delete all
61 other versions of the module being reinstalled (not simply older ones)
62 set the <varname>UNINST</varname> variable:</para>
63
64<screen><userinput>make install UNINST=1</userinput></screen>
65 </note>
66
67 </sect3>
68
69 <sect3 role="installation" id="new-perl-build-install"
70 xreflabel="instructions for packages using Build.PL">
71 <title>Installation of Perl Modules which use Build.PL</title>
72
73 <para>Install <application>Perl</application> modules which use
74 Build.PL by running the following commands:</para>
75
76<screen><userinput>perl Build.PL &amp;&amp;
77./Build &amp;&amp;
78./Build test</userinput></screen>
79
80 <para>Now, as the <systemitem class="username">root</systemitem> user:</para>
81
82<screen role="root"><userinput>./Build install</userinput></screen>
83
84 </sect3> -->
85
86 <sect3 role="installation" id="new-perl-auto-install"
87 xreflabel="automatic installation of perl modules">
88 <title> Automatic Installation of Perl Modules.</title>
89
90 <para>There is an alternate way of installing the modules using the
91 <command>cpan</command> shell <command>install</command> command. The
92 command automatically downloads the source from the CPAN archive, extracts
93 it, runs the compilation, testing and installation commands mentioned
94 above, and removes the build source tree. You may still need to install
95 dependent library packages before running the automated installation
96 method.</para>
97
98 <para>The first time you run <command>cpan</command>, you'll be prompted
99 to enter some information regarding download locations and methods. This
100 information is retained in files located in
101 <filename class='directory'>~/.cpan</filename>. Start the
102 <command>cpan</command> shell by issuing '<command>cpan</command>' as the
103 <systemitem class="username">root</systemitem> user. Any module may now be
104 installed from the
105 <emphasis role='underlined'><prompt>cpan&gt;&nbsp;</prompt></emphasis>
106 prompt with the command:</para>
107
108<screen role="root"><userinput>install <replaceable>&lt;Module::Name&gt;</replaceable></userinput></screen>
109
110 <para>For additional commands and help, issue '<command>help</command>'
111 from the
112 <emphasis role='underlined'><prompt>cpan&gt;&nbsp;</prompt></emphasis>
113 prompt.</para>
114
115 <para>Alternatively, for scripted or non-interactive installations, use the
116 following syntax as the
117 <systemitem class="username">root</systemitem> user to install one or more
118 modules:</para>
119
120<screen role="root"><userinput>cpan -i <replaceable>&lt;Module1::Name&gt; &lt;Module2::Name&gt;</replaceable></userinput></screen>
121
122 <para>Review the <filename>cpan.1</filename> man page for additional
123 parameters you can pass to <command>cpan</command> on the command
124 line.</para>
125
126 </sect3>
127
128 </sect2>
Note: See TracBrowser for help on using the repository browser.