Add built local::lib
[catagits/Gitalist.git] / local-lib5 / man / man3 / ExtUtils::MakeMaker::FAQ.3pm
1 .\" Automatically generated by Pod::Man v1.37, Pod::Parser v1.3
2 .\"
3 .\" Standard preamble:
4 .\" ========================================================================
5 .de Sh \" Subsection heading
6 .br
7 .if t .Sp
8 .ne 5
9 .PP
10 \fB\\$1\fR
11 .PP
12 ..
13 .de Sp \" Vertical space (when we can't use .PP)
14 .if t .sp .5v
15 .if n .sp
16 ..
17 .de Vb \" Begin verbatim text
18 .ft CW
19 .nf
20 .ne \\$1
21 ..
22 .de Ve \" End verbatim text
23 .ft R
24 .fi
25 ..
26 .\" Set up some character translations and predefined strings.  \*(-- will
27 .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left
28 .\" double quote, and \*(R" will give a right double quote.  | will give a
29 .\" real vertical bar.  \*(C+ will give a nicer C++.  Capital omega is used to
30 .\" do unbreakable dashes and therefore won't be available.  \*(C` and \*(C'
31 .\" expand to `' in nroff, nothing in troff, for use with C<>.
32 .tr \(*W-|\(bv\*(Tr
33 .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p'
34 .ie n \{\
35 .    ds -- \(*W-
36 .    ds PI pi
37 .    if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch
38 .    if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\"  diablo 12 pitch
39 .    ds L" ""
40 .    ds R" ""
41 .    ds C` ""
42 .    ds C' ""
43 'br\}
44 .el\{\
45 .    ds -- \|\(em\|
46 .    ds PI \(*p
47 .    ds L" ``
48 .    ds R" ''
49 'br\}
50 .\"
51 .\" If the F register is turned on, we'll generate index entries on stderr for
52 .\" titles (.TH), headers (.SH), subsections (.Sh), items (.Ip), and index
53 .\" entries marked with X<> in POD.  Of course, you'll have to process the
54 .\" output yourself in some meaningful fashion.
55 .if \nF \{\
56 .    de IX
57 .    tm Index:\\$1\t\\n%\t"\\$2"
58 ..
59 .    nr % 0
60 .    rr F
61 .\}
62 .\"
63 .\" For nroff, turn off justification.  Always turn off hyphenation; it makes
64 .\" way too many mistakes in technical documents.
65 .hy 0
66 .if n .na
67 .\"
68 .\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2).
69 .\" Fear.  Run.  Save yourself.  No user-serviceable parts.
70 .    \" fudge factors for nroff and troff
71 .if n \{\
72 .    ds #H 0
73 .    ds #V .8m
74 .    ds #F .3m
75 .    ds #[ \f1
76 .    ds #] \fP
77 .\}
78 .if t \{\
79 .    ds #H ((1u-(\\\\n(.fu%2u))*.13m)
80 .    ds #V .6m
81 .    ds #F 0
82 .    ds #[ \&
83 .    ds #] \&
84 .\}
85 .    \" simple accents for nroff and troff
86 .if n \{\
87 .    ds ' \&
88 .    ds ` \&
89 .    ds ^ \&
90 .    ds , \&
91 .    ds ~ ~
92 .    ds /
93 .\}
94 .if t \{\
95 .    ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u"
96 .    ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u'
97 .    ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u'
98 .    ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u'
99 .    ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u'
100 .    ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u'
101 .\}
102 .    \" troff and (daisy-wheel) nroff accents
103 .ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V'
104 .ds 8 \h'\*(#H'\(*b\h'-\*(#H'
105 .ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#]
106 .ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H'
107 .ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u'
108 .ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#]
109 .ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#]
110 .ds ae a\h'-(\w'a'u*4/10)'e
111 .ds Ae A\h'-(\w'A'u*4/10)'E
112 .    \" corrections for vroff
113 .if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u'
114 .if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u'
115 .    \" for low resolution devices (crt and lpr)
116 .if \n(.H>23 .if \n(.V>19 \
117 \{\
118 .    ds : e
119 .    ds 8 ss
120 .    ds o a
121 .    ds d- d\h'-1'\(ga
122 .    ds D- D\h'-1'\(hy
123 .    ds th \o'bp'
124 .    ds Th \o'LP'
125 .    ds ae ae
126 .    ds Ae AE
127 .\}
128 .rm #[ #] #H #V #F C
129 .\" ========================================================================
130 .\"
131 .IX Title "ExtUtils::MakeMaker::FAQ 3"
132 .TH ExtUtils::MakeMaker::FAQ 3 "2009-07-07" "perl v5.8.7" "User Contributed Perl Documentation"
133 .SH "NAME"
134 ExtUtils::MakeMaker::FAQ \- Frequently Asked Questions About MakeMaker
135 .SH "DESCRIPTION"
136 .IX Header "DESCRIPTION"
137 FAQs, tricks and tips for \f(CW\*(C`ExtUtils::MakeMaker\*(C'\fR.
138 .Sh "Module Installation"
139 .IX Subsection "Module Installation"
140 .IP "How do I install a module into my home directory?" 4
141 .IX Item "How do I install a module into my home directory?"
142 If you're not the Perl administrator you probably don't have
143 permission to install a module to its default location.  Then you
144 should install it for your own use into your home directory like so:
145 .Sp
146 .Vb 2
147 \&    # Non\-unix folks, replace ~ with /path/to/your/home/dir
148 \&    perl Makefile.PL INSTALL_BASE=~
149 .Ve
150 .Sp
151 This will put modules into \fI~/lib/perl5\fR, man pages into \fI~/man\fR and
152 programs into \fI~/bin\fR.
153 .Sp
154 To ensure your Perl programs can see these newly installed modules,
155 set your \f(CW\*(C`PERL5LIB\*(C'\fR environment variable to \fI~/lib/perl5\fR or tell
156 each of your programs to look in that directory with the following:
157 .Sp
158 .Vb 1
159 \&    use lib "$ENV{HOME}/lib/perl5";
160 .Ve
161 .Sp
162 or if \f(CW$ENV\fR{\s-1HOME\s0} isn't set and you don't want to set it for some
163 reason, do it the long way.
164 .Sp
165 .Vb 1
166 \&    use lib "/path/to/your/home/dir/lib/perl5";
167 .Ve
168 .IP "How do I get MakeMaker and Module::Build to install to the same place?" 4
169 .IX Item "How do I get MakeMaker and Module::Build to install to the same place?"
170 Module::Build, as of 0.28, supports two ways to install to the same
171 location as MakeMaker.
172 .Sp
173 1) Use \s-1INSTALL_BASE\s0 / \f(CW\*(C`\-\-install_base\*(C'\fR
174 .Sp
175 MakeMaker (as of 6.31) and Module::Build (as of 0.28) both can install
176 to the same locations using the \*(L"install_base\*(R" concept.  See
177 \&\*(L"\s-1INSTALL_BASE\s0\*(R" in ExtUtils::MakeMaker for details.  To get \s-1MM\s0 and \s-1MB\s0 to
178 install to the same location simply set \s-1INSTALL_BASE\s0 in \s-1MM\s0 and
179 \&\f(CW\*(C`\-\-install_base\*(C'\fR in \s-1MB\s0 to the same location.
180 .Sp
181 .Vb 2
182 \&    perl Makefile.PL INSTALL_BASE=/whatever
183 \&    perl Build.PL    \-\-install_base /whatever
184 .Ve
185 .Sp
186 2) Use \s-1PREFIX\s0 / \f(CW\*(C`\-\-prefix\*(C'\fR
187 .Sp
188 Module::Build 0.28 added support for \f(CW\*(C`\-\-prefix\*(C'\fR which works like
189 MakeMaker's \s-1PREFIX\s0.
190 .Sp
191 .Vb 2
192 \&    perl Makefile.PL PREFIX=/whatever
193 \&    perl Build.PL    \-\-prefix /whatever
194 .Ve
195 .IP "How do I keep from installing man pages?" 4
196 .IX Item "How do I keep from installing man pages?"
197 Recent versions of MakeMaker will only install man pages on Unix like
198 operating systems.
199 .Sp
200 For an individual module:
201 .Sp
202 .Vb 1
203 \&        perl Makefile.PL INSTALLMAN1DIR=none INSTALLMAN3DIR=none
204 .Ve
205 .Sp
206 If you want to suppress man page installation for all modules you have
207 to reconfigure Perl and tell it 'none' when it asks where to install
208 man pages.
209 .IP "How do I use a module without installing it?" 4
210 .IX Item "How do I use a module without installing it?"
211 Two ways.  One is to build the module normally...
212 .Sp
213 .Vb 3
214 \&        perl Makefile.PL
215 \&        make
216 \&        make test
217 .Ve
218 .Sp
219 \&...and then set the \s-1PERL5LIB\s0 environment variable to point at the
220 blib/lib and blib/arch directories.
221 .Sp
222 The other is to install the module in a temporary location.
223 .Sp
224 .Vb 4
225 \&        perl Makefile.PL INSTALL_BASE=~/tmp
226 \&        make
227 \&        make test
228 \&        make install
229 .Ve
230 .Sp
231 And then set \s-1PERL5LIB\s0 to \fI~/tmp/lib/perl5\fR.  This works well when you
232 have multiple modules to work with.  It also ensures that the module
233 goes through its full installation process which may modify it.
234 .IP "\s-1PREFIX\s0 vs \s-1INSTALL_BASE\s0 from Module::Build::Cookbook" 4
235 .IX Item "PREFIX vs INSTALL_BASE from Module::Build::Cookbook"
236 The behavior of \s-1PREFIX\s0 is complicated and depends closely on how your
237 Perl is configured. The resulting installation locations will vary from
238 machine to machine and even different installations of Perl on the same machine.
239 Because of this, its difficult to document where prefix will place your modules.
240 .Sp
241 In contrast, \s-1INSTALL_BASE\s0 has predictable, easy to explain installation locations.
242 Now that Module::Build and MakeMaker both have \s-1INSTALL_BASE\s0 there is little reason
243 to use \s-1PREFIX\s0 other than to preserve your existing installation locations. If you
244 are starting a fresh Perl installation we encourage you to use \s-1INSTALL_BASE\s0. If
245 you have an existing installation installed via \s-1PREFIX\s0, consider moving it to an
246 installation structure matching \s-1INSTALL_BASE\s0 and using that instead.
247 .Sh "Philosophy and History"
248 .IX Subsection "Philosophy and History"
249 .IP "Why not just use <insert other build config tool here>?" 4
250 .IX Item "Why not just use <insert other build config tool here>?"
251 Why did MakeMaker reinvent the build configuration wheel?  Why not
252 just use autoconf or automake or ppm or Ant or ...
253 .Sp
254 There are many reasons, but the major one is cross-platform
255 compatibility.
256 .Sp
257 Perl is one of the most ported pieces of software ever.  It works on
258 operating systems I've never even heard of (see perlport for details).
259 It needs a build tool that can work on all those platforms and with
260 any wacky C compilers and linkers they might have.
261 .Sp
262 No such build tool exists.  Even make itself has wildly different
263 dialects.  So we have to build our own.
264 .IP "What is Module::Build and how does it relate to MakeMaker?" 4
265 .IX Item "What is Module::Build and how does it relate to MakeMaker?"
266 Module::Build is a project by Ken Williams to supplant MakeMaker.
267 Its primary advantages are:
268 .RS 4
269 .IP "* pure perl.  no make, no shell commands" 8
270 .IX Item "pure perl.  no make, no shell commands"
271 .PD 0
272 .IP "* easier to customize" 8
273 .IX Item "easier to customize"
274 .IP "* cleaner internals" 8
275 .IX Item "cleaner internals"
276 .IP "* less cruft" 8
277 .IX Item "less cruft"
278 .RE
279 .RS 4
280 .PD
281 .Sp
282 Module::Build is the official heir apparent to MakeMaker and we
283 encourage people to work on M::B rather than spending time adding features
284 to MakeMaker.
285 .RE
286 .Sh "Module Writing"
287 .IX Subsection "Module Writing"
288 .ie n .IP "How do I keep my $VERSION up to date without resetting it manually?" 4
289 .el .IP "How do I keep my \f(CW$VERSION\fR up to date without resetting it manually?" 4
290 .IX Item "How do I keep my $VERSION up to date without resetting it manually?"
291 Often you want to manually set the \f(CW$VERSION\fR in the main module
292 distribution because this is the version that everybody sees on \s-1CPAN\s0
293 and maybe you want to customize it a bit.  But for all the other
294 modules in your dist, \f(CW$VERSION\fR is really just bookkeeping and all that's
295 important is it goes up every time the module is changed.  Doing this
296 by hand is a pain and you often forget.
297 .Sp
298 Simplest way to do it automatically is to use your version control
299 system's revision number (you are using version control, right?).
300 .Sp
301 In \s-1CVS\s0, \s-1RCS\s0 and \s-1SVN\s0 you use \f(CW$Revision\fR$ (see the documentation of your
302 version control system for details).  Every time the file is checked
303 in the \f(CW$Revision\fR$ will be updated, updating your \f(CW$VERSION\fR.
304 .Sp
305 \&\s-1SVN\s0 uses a simple integer for \f(CW$Revision\fR$ so you can adapt it for your
306 \&\f(CW$VERSION\fR like so:
307 .Sp
308 .Vb 1
309 \&    ($VERSION) = q$Revision$ =~ /(\ed+)/;
310 .Ve
311 .Sp
312 In \s-1CVS\s0 and \s-1RCS\s0 version 1.9 is followed by 1.10.  Since \s-1CPAN\s0 compares
313 version numbers numerically we use a \fIsprintf()\fR to convert 1.9 to 1.009
314 and 1.10 to 1.010 which compare properly.
315 .Sp
316 .Vb 1
317 \&    $VERSION = sprintf "%d.%03d", q$Revision$ =~ /(\ed+)\e.(\ed+)/g;
318 .Ve
319 .Sp
320 If branches are involved (ie. \f(CW$Revision:\fR 1.5.3.4$) its a little more
321 complicated.
322 .Sp
323 .Vb 2
324 \&    # must be all on one line or MakeMaker will get confused.
325 \&    $VERSION = do { my @r = (q$Revision$ =~ /\ed+/g); sprintf "%d."."%03d" x $#r, @r };
326 .Ve
327 .Sp
328 In \s-1SVN\s0, \f(CW$Revision\fR$ should be the same for every file in the project so
329 they would all have the same \f(CW$VERSION\fR.  \s-1CVS\s0 and \s-1RCS\s0 have a different
330 \&\f(CW$Revision\fR$ per file so each file will have a differnt \f(CW$VERSION\fR.
331 Distributed version control systems, such as \s-1SVK\s0, may have a different
332 \&\f(CW$Revision\fR$ based on who checks out the file leading to a different \f(CW$VERSION\fR
333 on each machine!  Finally, some distributed version control systems, such
334 as darcs, have no concept of revision number at all.
335 .IP "What's this \fI\s-1META\s0.yml\fR thing and how did it get in my \fI\s-1MANIFEST\s0\fR?!" 4
336 .IX Item "What's this META.yml thing and how did it get in my MANIFEST?!"
337 \&\fI\s-1META\s0.yml\fR is a module meta-data file pioneered by Module::Build and
338 automatically generated as part of the 'distdir' target (and thus
339 \&'dist').  See \*(L"Module Meta\-Data\*(R" in ExtUtils::MakeMaker.
340 .Sp
341 To shut off its generation, pass the \f(CW\*(C`NO_META\*(C'\fR flag to \f(CW\*(C`WriteMakefile()\*(C'\fR.
342 .IP "How do I delete everything not in my \fI\s-1MANIFEST\s0\fR?" 4
343 .IX Item "How do I delete everything not in my MANIFEST?"
344 Some folks are surpried that \f(CW\*(C`make distclean\*(C'\fR does not delete
345 everything not listed in their \s-1MANIFEST\s0 (thus making a clean
346 distribution) but only tells them what they need to delete.  This is
347 done because it is considered too dangerous.  While developing your
348 module you might write a new file, not add it to the \s-1MANIFEST\s0, then
349 run a \f(CW\*(C`distclean\*(C'\fR and be sad because your new work was deleted.
350 .Sp
351 If you really want to do this, you can use
352 \&\f(CW\*(C`ExtUtils::Manifest::manifind()\*(C'\fR to read the \s-1MANIFEST\s0 and File::Find
353 to delete the files.  But you have to be careful.  Here's a script to
354 do that.  Use at your own risk.  Have fun blowing holes in your foot.
355 .Sp
356 .Vb 1
357 \&    #!/usr/bin/perl \-w
358 .Ve
359 .Sp
360 .Vb 1
361 \&    use strict;
362 .Ve
363 .Sp
364 .Vb 3
365 \&    use File::Spec;
366 \&    use File::Find;
367 \&    use ExtUtils::Manifest qw(maniread);
368 .Ve
369 .Sp
370 .Vb 3
371 \&    my %manifest = map  {( $_ => 1 )}
372 \&                   grep { File::Spec\->canonpath($_) }
373 \&                        keys %{ maniread() };
374 .Ve
375 .Sp
376 .Vb 4
377 \&    if( !keys %manifest ) {
378 \&        print "No files found in MANIFEST.  Stopping.\en";
379 \&        exit;
380 \&    }
381 .Ve
382 .Sp
383 .Vb 3
384 \&    find({
385 \&          wanted   => sub {
386 \&              my $path = File::Spec\->canonpath($_);
387 .Ve
388 .Sp
389 .Vb 2
390 \&              return unless \-f $path;
391 \&              return if exists $manifest{ $path };
392 .Ve
393 .Sp
394 .Vb 7
395 \&              print "unlink $path\en";
396 \&              unlink $path;
397 \&          },
398 \&          no_chdir => 1
399 \&         },
400 \&         "."
401 \&    );
402 .Ve
403 .IP "Which zip should I use on Windows for '[nd]make zipdist'?" 4
404 .IX Item "Which zip should I use on Windows for '[nd]make zipdist'?"
405 We recommend InfoZIP: <http://www.info\-zip.org/Zip.html>
406 .Sh "\s-1XS\s0"
407 .IX Subsection "XS"
408 .ie n .IP "How to I prevent ""object version X.XX does not match bootstrap parameter Y.YY"" errors?" 4
409 .el .IP "How to I prevent ``object version X.XX does not match bootstrap parameter Y.YY'' errors?" 4
410 .IX Item "How to I prevent object version X.XX does not match bootstrap parameter Y.YY errors?"
411 \&\s-1XS\s0 code is very sensitive to the module version number and will
412 complain if the version number in your Perl module doesn't match.  If
413 you change your module's version # without rerunning Makefile.PL the old
414 version number will remain in the Makefile causing the \s-1XS\s0 code to be built
415 with the wrong number.
416 .Sp
417 To avoid this, you can force the Makefile to be rebuilt whenever you
418 change the module containing the version number by adding this to your
419 \&\fIWriteMakefile()\fR arguments.
420 .Sp
421 .Vb 1
422 \&    depend => { '$(FIRST_MAKEFILE)' => '$(VERSION_FROM)' }
423 .Ve
424 .IP "How do I make two or more \s-1XS\s0 files coexist in the same directory?" 4
425 .IX Item "How do I make two or more XS files coexist in the same directory?"
426 Sometimes you need to have two and more \s-1XS\s0 files in the same package.
427 One way to go is to put them into separate directories, but sometimes
428 this is not the most suitable solution. The following technique allows
429 you to put two (and more) \s-1XS\s0 files in the same directory.
430 .Sp
431 Let's assume that we have a package \f(CW\*(C`Cool::Foo\*(C'\fR, which includes
432 \&\f(CW\*(C`Cool::Foo\*(C'\fR and \f(CW\*(C`Cool::Bar\*(C'\fR modules each having a separate \s-1XS\s0
433 file. First we use the following \fIMakefile.PL\fR:
434 .Sp
435 .Vb 1
436 \&  use ExtUtils::MakeMaker;
437 .Ve
438 .Sp
439 .Vb 6
440 \&  WriteMakefile(
441 \&      NAME              => 'Cool::Foo',
442 \&      VERSION_FROM      => 'Foo.pm',
443 \&      OBJECT              => q/$(O_FILES)/,
444 \&      # ... other attrs ...
445 \&  );
446 .Ve
447 .Sp
448 Notice the \f(CW\*(C`OBJECT\*(C'\fR attribute. MakeMaker generates the following
449 variables in \fIMakefile\fR:
450 .Sp
451 .Vb 7
452 \&  # Handy lists of source code files:
453 \&  XS_FILES= Bar.xs \e
454 \&        Foo.xs
455 \&  C_FILES = Bar.c \e
456 \&        Foo.c
457 \&  O_FILES = Bar.o \e
458 \&        Foo.o
459 .Ve
460 .Sp
461 Therefore we can use the \f(CW\*(C`O_FILES\*(C'\fR variable to tell MakeMaker to use
462 these objects into the shared library.
463 .Sp
464 That's pretty much it. Now write \fIFoo.pm\fR and \fIFoo.xs\fR, \fIBar.pm\fR
465 and \fIBar.xs\fR, where \fIFoo.pm\fR bootstraps the shared library and
466 \&\fIBar.pm\fR simply loading \fIFoo.pm\fR.
467 .Sp
468 The only issue left is to how to bootstrap \fIBar.xs\fR. This is done
469 from \fIFoo.xs\fR:
470 .Sp
471 .Vb 1
472 \&  MODULE = Cool::Foo PACKAGE = Cool::Foo
473 .Ve
474 .Sp
475 .Vb 3
476 \&  BOOT:
477 \&  # boot the second XS file
478 \&  boot_Cool__Bar(aTHX_ cv);
479 .Ve
480 .Sp
481 If you have more than two files, this is the place where you should
482 boot extra \s-1XS\s0 files from.
483 .Sp
484 The following four files sum up all the details discussed so far.
485 .Sp
486 .Vb 3
487 \&  Foo.pm:
488 \&  \-\-\-\-\-\-\-
489 \&  package Cool::Foo;
490 .Ve
491 .Sp
492 .Vb 1
493 \&  require DynaLoader;
494 .Ve
495 .Sp
496 .Vb 3
497 \&  our @ISA = qw(DynaLoader);
498 \&  our $VERSION = '0.01';
499 \&  bootstrap Cool::Foo $VERSION;
500 .Ve
501 .Sp
502 .Vb 1
503 \&  1;
504 .Ve
505 .Sp
506 .Vb 3
507 \&  Bar.pm:
508 \&  \-\-\-\-\-\-\-
509 \&  package Cool::Bar;
510 .Ve
511 .Sp
512 .Vb 1
513 \&  use Cool::Foo; # bootstraps Bar.xs
514 .Ve
515 .Sp
516 .Vb 1
517 \&  1;
518 .Ve
519 .Sp
520 .Vb 5
521 \&  Foo.xs:
522 \&  \-\-\-\-\-\-\-
523 \&  #include "EXTERN.h"
524 \&  #include "perl.h"
525 \&  #include "XSUB.h"
526 .Ve
527 .Sp
528 .Vb 1
529 \&  MODULE = Cool::Foo  PACKAGE = Cool::Foo
530 .Ve
531 .Sp
532 .Vb 3
533 \&  BOOT:
534 \&  # boot the second XS file
535 \&  boot_Cool__Bar(aTHX_ cv);
536 .Ve
537 .Sp
538 .Vb 1
539 \&  MODULE = Cool::Foo  PACKAGE = Cool::Foo  PREFIX = cool_foo_
540 .Ve
541 .Sp
542 .Vb 2
543 \&  void
544 \&  cool_foo_perl_rules()
545 .Ve
546 .Sp
547 .Vb 2
548 \&      CODE:
549 \&      fprintf(stderr, "Cool::Foo says: Perl Rules\en");
550 .Ve
551 .Sp
552 .Vb 5
553 \&  Bar.xs:
554 \&  \-\-\-\-\-\-\-
555 \&  #include "EXTERN.h"
556 \&  #include "perl.h"
557 \&  #include "XSUB.h"
558 .Ve
559 .Sp
560 .Vb 1
561 \&  MODULE = Cool::Bar  PACKAGE = Cool::Bar PREFIX = cool_bar_
562 .Ve
563 .Sp
564 .Vb 2
565 \&  void
566 \&  cool_bar_perl_rules()
567 .Ve
568 .Sp
569 .Vb 2
570 \&      CODE:
571 \&      fprintf(stderr, "Cool::Bar says: Perl Rules\en");
572 .Ve
573 .Sp
574 And of course a very basic test:
575 .Sp
576 .Vb 9
577 \&  t/cool.t:
578 \&  \-\-\-\-\-\-\-\-
579 \&  use Test;
580 \&  BEGIN { plan tests => 1 };
581 \&  use Cool::Foo;
582 \&  use Cool::Bar;
583 \&  Cool::Foo::perl_rules();
584 \&  Cool::Bar::perl_rules();
585 \&  ok 1;
586 .Ve
587 .Sp
588 This tip has been brought to you by Nick Ing-Simmons and Stas Bekman.
589 .SH "PATCHING"
590 .IX Header "PATCHING"
591 If you have a question you'd like to see added to the \s-1FAQ\s0 (whether or
592 not you have the answer) please send it to makemaker@perl.org.
593 .SH "AUTHOR"
594 .IX Header "AUTHOR"
595 The denizens of makemaker@perl.org.
596 .SH "SEE ALSO"
597 .IX Header "SEE ALSO"
598 ExtUtils::MakeMaker