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