ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/App-Staticperl/staticperl.pod
(Generate patch)

Comparing App-Staticperl/staticperl.pod (file contents):
Revision 1.13 by root, Tue Dec 7 19:55:56 2010 UTC vs.
Revision 1.14 by root, Wed Dec 8 22:27:35 2010 UTC

14 staticperl cpan # invoke CPAN shell 14 staticperl cpan # invoke CPAN shell
15 staticperl instmod path... # install unpacked modules 15 staticperl instmod path... # install unpacked modules
16 staticperl instcpan modulename... # install modules from CPAN 16 staticperl instcpan modulename... # install modules from CPAN
17 staticperl mkbundle <bundle-args...> # see documentation 17 staticperl mkbundle <bundle-args...> # see documentation
18 staticperl mkperl <bundle-args...> # see documentation 18 staticperl mkperl <bundle-args...> # see documentation
19 staticperl mkapp appname <bundle-args...> # see documentation
19 20
20Typical Examples: 21Typical Examples:
21 22
22 staticperl install # fetch, configure, build and install perl 23 staticperl install # fetch, configure, build and install perl
23 staticperl cpan # run interactive cpan shell 24 staticperl cpan # run interactive cpan shell
24 staticperl mkperl -M '"Config_heavy.pl"' # build a perl that supports -V 25 staticperl mkperl -M '"Config_heavy.pl"' # build a perl that supports -V
25 staticperl mkperl -MAnyEvent::Impl::Perl -MAnyEvent::HTTPD -MURI -MURI::http 26 staticperl mkperl -MAnyEvent::Impl::Perl -MAnyEvent::HTTPD -MURI -MURI::http
26 # build a perl with the above modules linked in 27 # build a perl with the above modules linked in
28 staticperl mkapp myapp --boot mainprog mymodules
29 # build a binary "myapp" from mainprog and mymodules
27 30
28=head1 DESCRIPTION 31=head1 DESCRIPTION
29 32
30This script helps you creating single-file perl interpreters, or embedding 33This script helps you creating single-file perl interpreters, or embedding
31a perl interpreter in your applications. Single-file means that it is 34a perl interpreter in your applications. Single-file means that it is
244(required by L<AnyEvent::HTTPD>) implements various URI schemes as extra 247(required by L<AnyEvent::HTTPD>) implements various URI schemes as extra
245modules - since L<AnyEvent::HTTPD> only needs C<http> URIs, we only need 248modules - since L<AnyEvent::HTTPD> only needs C<http> URIs, we only need
246to include that module. I found out about these dependencies by carefully 249to include that module. I found out about these dependencies by carefully
247watching any error messages about missing modules... 250watching any error messages about missing modules...
248 251
252Instead of building a new perl binary, you can also build a standalone
253application:
254
255 # build the app
256 staticperl mkapp app --boot eg/httpd \
257 -MAnyEvent::Impl::Perl -MAnyEvent::HTTPD -MURI::http
258
259 # run it
260 ./app
261
249=head3 OPTION PROCESSING 262=head3 OPTION PROCESSING
250 263
251All options can be given as arguments on the command line (typically 264All options can be given as arguments on the command line (typically
252using long (e.g. C<--verbose>) or short option (e.g. C<-v>) style). Since 265using long (e.g. C<--verbose>) or short option (e.g. C<-v>) style). Since
253specifying a lot of modules can make the command line very cumbersome, 266specifying a lot of modules can make the command line very cumbersome,
312C<mkperl> command (instead of C<mkbundle>): 325C<mkperl> command (instead of C<mkbundle>):
313 326
314 # build a new ./perl with only common::sense in it - very small :) 327 # build a new ./perl with only common::sense in it - very small :)
315 staticperl mkperl -Mcommon::sense 328 staticperl mkperl -Mcommon::sense
316 329
330=item --app name
331
332After writing out the bundle files, try to link a new standalone
333program. It will be called C<name>, and the bundle files get removed after
334linking it.
335
336The difference to the (mutually exclusive) C<--perl> option is that the
337binary created by this option will not try to act as a perl interpreter -
338instead it will simply initialise the perl interpreter, clean it up and
339exit.
340
341This switch is automatically used when F<staticperl> is invoked with the
342C<mkapp> command (instead of C<mkbundle>):
343
344To let it do something useful you I<must> add some boot code, e.g. with
345the C<--boot> option.
346
347Example: create a standalone perl binary that will execute F<appfile> when
348it is started.
349
350 staticperl mkbundle --app myexe --boot appfile
351
317=item --use module | -Mmodule 352=item --use module | -Mmodule
318 353
319Include the named module and all direct dependencies. This is done by 354Include the named module and all direct dependencies. This is done by
320C<require>'ing the module in a subprocess and tracing which other modules 355C<require>'ing the module in a subprocess and tracing which other modules
321and files it actually loads. If the module uses L<AutoLoader>, then all 356and files it actually loads. If the module uses L<AutoLoader>, then all

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines