Debian Codegraph @

upstream/mageia-cauldron/man3pm/AutoSplit.3pm

raw
1 .\" -*- mode: troff; coding: utf-8 -*-
2 .\" Automatically generated by Pod::Man v6.0.2 (Pod::Simple 3.45)
3 .\"
4 .\" Standard preamble:
5 .\" ========================================================================
6 .de Sp \" Vertical space (when we can't use .PP)
7 .if t .sp .5v
8 .if n .sp
9 ..
10 .de Vb \" Begin verbatim text
11 .ft CW
12 .nf
13 .ne \\$1
14 ..
15 .de Ve \" End verbatim text
16 .ft R
17 .fi
18 ..
19 .\" \*(C` and \*(C' are quotes in nroff, nothing in troff, for use with C<>.
20 .ie n \{\
21 . ds C` ""
22 . ds C' ""
23 'br\}
24 .el\{\
25 . ds C`
26 . ds C'
27 'br\}
28 .\"
29 .\" Escape single quotes in literal strings from groff's Unicode transform.
30 .ie \n(.g .ds Aq \(aq
31 .el .ds Aq '
32 .\"
33 .\" If the F register is >0, we'll generate index entries on stderr for
34 .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index
35 .\" entries marked with X<> in POD. Of course, you'll have to process the
36 .\" output yourself in some meaningful fashion.
37 .\"
38 .\" Avoid warning from groff about undefined register 'F'.
39 .de IX
40 ..
41 .nr rF 0
42 .if \n(.g .if rF .nr rF 1
43 .if (\n(rF:(\n(.g==0)) \{\
44 . if \nF \{\
45 . de IX
46 . tm Index:\\$1\t\\n%\t"\\$2"
47 ..
48 . if !\nF==2 \{\
49 . nr % 0
50 . nr F 2
51 . \}
52 . \}
53 .\}
54 .rr rF
55 .\"
56 .\" Required to disable full justification in groff 1.23.0.
57 .if n .ds AD l
58 .\" ========================================================================
59 .\"
60 .IX Title "AutoSplit 3pm"
61 .TH AutoSplit 3pm 2023-12-22 "perl v5.42.0" "Perl Programmers Reference Guide"
62 .\" For nroff, turn off justification. Always turn off hyphenation; it makes
63 .\" way too many mistakes in technical documents.
64 .if n .ad l
65 .nh
66 .SH NAME
67 AutoSplit \- split a package for autoloading
68 .SH SYNOPSIS
69 .IX Header "SYNOPSIS"
70 .Vb 1
71 \& autosplit($file, $dir, $keep, $check, $modtime);
72 \&
73 \& autosplit_lib_modules(@modules);
74 .Ve
75 .SH DESCRIPTION
76 .IX Header "DESCRIPTION"
77 This function will split up your program into files that the AutoLoader
78 module can handle. It is used by both the standard perl libraries and by
79 the MakeMaker utility, to automatically configure libraries for autoloading.
80 .PP
81 The \f(CW\*(C`autosplit\*(C'\fR interface splits the specified file into a hierarchy
82 rooted at the directory \f(CW$dir\fR. It creates directories as needed to reflect
83 class hierarchy, and creates the file \fIautosplit.ix\fR. This file acts as
84 both forward declaration of all package routines, and as timestamp for the
85 last update of the hierarchy.
86 .PP
87 The remaining three arguments to \f(CW\*(C`autosplit\*(C'\fR govern other options to
88 the autosplitter.
89 .ie n .IP $keep 2
90 .el .IP \f(CW$keep\fR 2
91 .IX Item "$keep"
92 If the third argument, \fR\f(CI$keep\fR\fI\fR, is false, then any
93 pre\-existing \f(CW\*(C`*.al\*(C'\fR files in the autoload directory are removed if
94 they are no longer part of the module (obsoleted functions).
95 \&\f(CW$keep\fR defaults to 0.
96 .ie n .IP $check 2
97 .el .IP \f(CW$check\fR 2
98 .IX Item "$check"
99 The
100 fourth argument, \fR\f(CI$check\fR\fI\fR, instructs \f(CW\*(C`autosplit\*(C'\fR to check the module
101 currently being split to ensure that it includes a \f(CW\*(C`use\*(C'\fR
102 specification for the AutoLoader module, and skips the module if
103 AutoLoader is not detected.
104 \&\f(CW$check\fR defaults to 1.
105 .ie n .IP $modtime 2
106 .el .IP \f(CW$modtime\fR 2
107 .IX Item "$modtime"
108 Lastly, the \fR\f(CI$modtime\fR\fI\fR argument specifies
109 that \f(CW\*(C`autosplit\*(C'\fR is to check the modification time of the module
110 against that of the \f(CW\*(C`autosplit.ix\*(C'\fR file, and only split the module if
111 it is newer.
112 \&\f(CW$modtime\fR defaults to 1.
113 .PP
114 Typical use of AutoSplit in the perl MakeMaker utility is via the command\-line
115 with:
116 .PP
117 .Vb 1
118 \& perl \-e \*(Aquse AutoSplit; autosplit($ARGV[0], $ARGV[1], 0, 1, 1)\*(Aq
119 .Ve
120 .PP
121 Defined as a Make macro, it is invoked with file and directory arguments;
122 \&\f(CW\*(C`autosplit\*(C'\fR will split the specified file into the specified directory and
123 delete obsolete \f(CW\*(C`.al\*(C'\fR files, after checking first that the module does use
124 the AutoLoader, and ensuring that the module is not already currently split
125 in its current form (the modtime test).
126 .PP
127 The \f(CW\*(C`autosplit_lib_modules\*(C'\fR form is used in the building of perl. It takes
128 as input a list of files (modules) that are assumed to reside in a directory
129 \&\fBlib\fR relative to the current directory. Each file is sent to the
130 autosplitter one at a time, to be split into the directory \fBlib/auto\fR.
131 .PP
132 In both usages of the autosplitter, only subroutines defined following the
133 perl \fI_\|_END_\|_\fR token are split out into separate files. Some
134 routines may be placed prior to this marker to force their immediate loading
135 and parsing.
136 .SS "Multiple packages"
137 .IX Subsection "Multiple packages"
138 As of version 1.01 of the AutoSplit module it is possible to have
139 multiple packages within a single file. Both of the following cases
140 are supported:
141 .PP
142 .Vb 7
143 \& package NAME;
144 \& _\|_END_\|_
145 \& sub AAA { ... }
146 \& package NAME::option1;
147 \& sub BBB { ... }
148 \& package NAME::option2;
149 \& sub BBB { ... }
150 \&
151 \& package NAME;
152 \& _\|_END_\|_
153 \& sub AAA { ... }
154 \& sub NAME::option1::BBB { ... }
155 \& sub NAME::option2::BBB { ... }
156 .Ve
157 .SH DIAGNOSTICS
158 .IX Header "DIAGNOSTICS"
159 \&\f(CW\*(C`AutoSplit\*(C'\fR will inform the user if it is necessary to create the
160 top\-level directory specified in the invocation. It is preferred that
161 the script or installation process that invokes \f(CW\*(C`AutoSplit\*(C'\fR have
162 created the full directory path ahead of time. This warning may
163 indicate that the module is being split into an incorrect path.
164 .PP
165 \&\f(CW\*(C`AutoSplit\*(C'\fR will warn the user of all subroutines whose name causes
166 potential file naming conflicts on machines with drastically limited
167 (8 characters or less) file name length. Since the subroutine name is
168 used as the file name, these warnings can aid in portability to such
169 systems.
170 .PP
171 Warnings are issued and the file skipped if \f(CW\*(C`AutoSplit\*(C'\fR cannot locate
172 either the \fI_\|_END_\|_\fR marker or a "package Name;"\-style specification.
173 .PP
174 \&\f(CW\*(C`AutoSplit\*(C'\fR will also emit general diagnostics for inability to
175 create directories or files.
176 .SH AUTHOR
177 .IX Header "AUTHOR"
178 \&\f(CW\*(C`AutoSplit\*(C'\fR is maintained by the perl5\-porters. Please direct
179 any questions to the canonical mailing list. Anything that
180 is applicable to the CPAN release can be sent to its maintainer,
181 though.
182 .PP
183 Author and Maintainer: The Perl5\-Porters <perl5\[email protected]>
184 .PP
185 Maintainer of the CPAN release: Steffen Mueller <[email protected]>
186 .SH "COPYRIGHT AND LICENSE"
187 .IX Header "COPYRIGHT AND LICENSE"
188 This package has been part of the perl core since the first release
189 of perl5. It has been released separately to CPAN so older installations
190 can benefit from bug fixes.
191 .PP
192 This package has the same copyright and license as the perl core:
193 .PP
194 .Vb 3
195 \& Copyright (C) 1993, 1994, 1995, 1996, 1997, 1998, 1999,
196 \& 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008
197 \& by Larry Wall and others
198 \&
199 \& All rights reserved.
200 \&
201 \& This program is free software; you can redistribute it and/or modify
202 \& it under the terms of either:
203 \&
204 \& a) the GNU General Public License as published by the Free
205 \& Software Foundation; either version 1, or (at your option) any
206 \& later version, or
207 \&
208 \& b) the "Artistic License" which comes with this Kit.
209 \&
210 \& This program is distributed in the hope that it will be useful,
211 \& but WITHOUT ANY WARRANTY; without even the implied warranty of
212 \& MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See either
213 \& the GNU General Public License or the Artistic License for more details.
214 \&
215 \& You should have received a copy of the Artistic License with this
216 \& Kit, in the file named "Artistic". If not, I\*(Aqll be glad to provide one.
217 \&
218 \& You should also have received a copy of the GNU General Public License
219 \& along with this program in the file named "Copying". If not, write to the
220 \& Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
221 \& 02111\-1307, USA or visit their web page on the internet at
222 \& http://www.gnu.org/copyleft/gpl.html.
223 \&
224 \& For those of you that choose to use the GNU General Public License,
225 \& my interpretation of the GNU General Public License is that no Perl
226 \& script falls under the terms of the GPL unless you explicitly put
227 \& said script under the terms of the GPL yourself. Furthermore, any
228 \& object code linked with perl does not automatically fall under the
229 \& terms of the GPL, provided such object code only adds definitions
230 \& of subroutines and variables, and does not otherwise impair the
231 \& resulting interpreter from executing any standard Perl script. I
232 \& consider linking in C subroutines in this manner to be the moral
233 \& equivalent of defining subroutines in the Perl language itself. You
234 \& may sell such an object file as proprietary provided that you provide
235 \& or offer to provide the Perl source, as specified by the GNU General
236 \& Public License. (This is merely an alternate way of specifying input
237 \& to the program.) You may also sell a binary produced by the dumping of
238 \& a running Perl script that belongs to you, provided that you provide or
239 \& offer to provide the Perl source as specified by the GPL. (The
240 \& fact that a Perl interpreter and your code are in the same binary file
241 \& is, in this case, a form of mere aggregation.) This is my interpretation
242 \& of the GPL. If you still have concerns or difficulties understanding
243 \& my intent, feel free to contact me. Of course, the Artistic License
244 \& spells all this out for your protection, so you may prefer to use that.
245 .Ve