2 <!DOCTYPE html PUBLIC
"-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
3 <html xmlns=
"http://www.w3.org/1999/xhtml">
5 <title>AutoSplit - split a package for autoloading
</title>
6 <meta http-equiv=
"content-type" content=
"text/html; charset=utf-8" />
7 <link rev=
"made" href=
"mailto:" />
10 <body style=
"background-color: white">
11 <table border=
"0" width=
"100%" cellspacing=
"0" cellpadding=
"3">
12 <tr><td class=
"block" style=
"background-color: #cccccc" valign=
"middle">
13 <big><strong><span class=
"block"> AutoSplit - split a package for autoloading
</span></strong></big>
17 <p><a name=
"__index__"></a></p>
22 <li><a href=
"#name">NAME
</a></li>
23 <li><a href=
"#synopsis">SYNOPSIS
</a></li>
24 <li><a href=
"#description">DESCRIPTION
</a></li>
27 <li><a href=
"#multiple_packages">Multiple packages
</a></li>
30 <li><a href=
"#diagnostics">DIAGNOSTICS
</a></li>
37 <h1><a name=
"name">NAME
</a></h1>
38 <p>AutoSplit - split a package for autoloading
</p>
42 <h1><a name=
"synopsis">SYNOPSIS
</a></h1>
44 autosplit($file, $dir, $keep, $check, $modtime);
</pre>
46 autosplit_lib_modules(@modules);
</pre>
50 <h1><a name=
"description">DESCRIPTION
</a></h1>
51 <p>This function will split up your program into files that the AutoLoader
52 module can handle. It is used by both the standard perl libraries and by
53 the MakeMaker utility, to automatically configure libraries for autoloading.
</p>
54 <p>The
<code>autosplit
</code> interface splits the specified file into a hierarchy
55 rooted at the directory
<code>$dir
</code>. It creates directories as needed to reflect
56 class hierarchy, and creates the file
<em>autosplit.ix
</em>. This file acts as
57 both forward declaration of all package routines, and as timestamp for the
58 last update of the hierarchy.
</p>
59 <p>The remaining three arguments to
<code>autosplit
</code> govern other options to
62 <dt><strong><a name=
"item__keep">$keep
</a></strong>
65 <p>If the third argument,
<em>$keep
</em>, is false, then any
66 pre-existing
<code>*.al
</code> files in the autoload directory are removed if
67 they are no longer part of the module (obsoleted functions).
68 $keep defaults to
0.
</p>
71 <dt><strong><a name=
"item__check">$check
</a></strong>
75 fourth argument,
<em>$check
</em>, instructs
<code>autosplit
</code> to check the module
76 currently being split to ensure that it includes a
<a href=
"file://C|\msysgit\mingw\html/pod/perlfunc.html#item_use"><code>use
</code></a>
77 specification for the AutoLoader module, and skips the module if
78 AutoLoader is not detected.
79 $check defaults to
1.
</p>
82 <dt><strong><a name=
"item__modtime">$modtime
</a></strong>
85 <p>Lastly, the
<em>$modtime
</em> argument specifies
86 that
<code>autosplit
</code> is to check the modification time of the module
87 against that of the
<code>autosplit.ix
</code> file, and only split the module if
89 $modtime defaults to
1.
</p>
93 <p>Typical use of AutoSplit in the perl MakeMaker utility is via the command-line
96 perl -e 'use AutoSplit; autosplit($ARGV[
0], $ARGV[
1],
0,
1,
1)'
</pre>
97 <p>Defined as a Make macro, it is invoked with file and directory arguments;
98 <code>autosplit
</code> will split the specified file into the specified directory and
99 delete obsolete
<code>.al
</code> files, after checking first that the module does use
100 the AutoLoader, and ensuring that the module is not already currently split
101 in its current form (the modtime test).
</p>
102 <p>The
<code>autosplit_lib_modules
</code> form is used in the building of perl. It takes
103 as input a list of files (modules) that are assumed to reside in a directory
104 <strong>lib
</strong> relative to the current directory. Each file is sent to the
105 autosplitter one at a time, to be split into the directory
<strong>lib/auto
</strong>.
</p>
106 <p>In both usages of the autosplitter, only subroutines defined following the
107 perl
<em>__END__
</em> token are split out into separate files. Some
108 routines may be placed prior to this marker to force their immediate loading
112 <h2><a name=
"multiple_packages">Multiple packages
</a></h2>
113 <p>As of version
1.01 of the AutoSplit module it is possible to have
114 multiple packages within a single file. Both of the following cases
120 package NAME::option1;
122 package NAME::option2;
123 sub BBB { ... }
</pre>
128 sub NAME::option1::BBB { ... }
129 sub NAME::option2::BBB { ... }
</pre>
133 <h1><a name=
"diagnostics">DIAGNOSTICS
</a></h1>
134 <p><code>AutoSplit
</code> will inform the user if it is necessary to create the
135 top-level directory specified in the invocation. It is preferred that
136 the script or installation process that invokes
<code>AutoSplit
</code> have
137 created the full directory path ahead of time. This warning may
138 indicate that the module is being split into an incorrect path.
</p>
139 <p><code>AutoSplit
</code> will warn the user of all subroutines whose name causes
140 potential file naming conflicts on machines with drastically limited
141 (
8 characters or less) file name length. Since the subroutine name is
142 used as the file name, these warnings can aid in portability to such
144 <p>Warnings are issued and the file skipped if
<code>AutoSplit
</code> cannot locate
145 either the
<em>__END__
</em> marker or a ``package Name;''-style specification.
</p>
146 <p><code>AutoSplit
</code> will also emit general diagnostics for inability to
147 create directories or files.
</p>
148 <table border=
"0" width=
"100%" cellspacing=
"0" cellpadding=
"3">
149 <tr><td class=
"block" style=
"background-color: #cccccc" valign=
"middle">
150 <big><strong><span class=
"block"> AutoSplit - split a package for autoloading
</span></strong></big>