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.33 by root, Wed Feb 9 10:23:37 2011 UTC vs.
Revision 1.34 by root, Thu Feb 10 08:58:36 2011 UTC

467 --incglob '/unicore/**.pl' 467 --incglob '/unicore/**.pl'
468 468
469=item C<--add> F<file> | C<--add> "F<file> alias" 469=item C<--add> F<file> | C<--add> "F<file> alias"
470 470
471Adds the given (perl) file into the bundle (and optionally call it 471Adds the given (perl) file into the bundle (and optionally call it
472"alias"). The F<file> is either an absolute path or a path relative to 472"alias"). The F<file> is either an absolute path or a path relative to the
473the current directory. If an alias is specified, then this is the name it 473current directory. If an alias is specified, then this is the name it will
474will use for C<@INC> searches, otherwise the F<file> will be used as the 474use for C<@INC> searches, otherwise the path F<&file> will be used as the
475internal name. 475internal name.
476 476
477This switch is used to include extra files into the bundle. 477This switch is used to include extra files into the bundle.
478 478
479Example: embed the file F<httpd> in the current directory as F<httpd.pm> 479Example: embed the file F<httpd> in the current directory as F<httpd.pm>
480when creating the bundle. 480when creating the bundle.
481 481
482 staticperl mkperl --add "httpd httpd.pm" 482 staticperl mkperl --add "httpd httpd.pm"
483
484 # can be accessed via "use httpd"
485
486Example: add a file F<initcode> from the current directory.
487
488 staticperl mkperl --add initcode
489
490 # can be accessed via "do '&initcode'"
483 491
484Example: add local files as extra modules in the bundle. 492Example: add local files as extra modules in the bundle.
485 493
486 # specification file 494 # specification file
487 add file1 myfiles/file1.pm 495 add file1 myfiles/file1.pm
497 505
498Just like C<--add>, except that it treats the file as binary and adds it 506Just like C<--add>, except that it treats the file as binary and adds it
499without any postprocessing (perl files might get stripped to reduce their 507without any postprocessing (perl files might get stripped to reduce their
500size). 508size).
501 509
502You should probably add a C</> prefix to avoid clashing with embedded perl 510If you specify an alias you should probably add a C<&> prefix to avoid
503files (whose paths do not start with C</>), and/or use a special directory 511clashing with embedded perl files (whose paths never start with C<&>),
504prefix, such as C</res/name>. 512and/or use a special directory prefix, such as C<&res/name>.
505 513
506You can later get a copy of these files by calling C<staticperl::find 514You can later get a copy of these files by calling C<staticperl::find
507"alias">. 515"alias">.
508 516
509An alternative way to embed binary files is to convert them to perl and 517An alternative way to embed binary files is to convert them to perl and
664The difference to the (mutually exclusive) C<--perl> option is that the 672The difference to the (mutually exclusive) C<--perl> option is that the
665binary created by this option will not try to act as a perl interpreter - 673binary created by this option will not try to act as a perl interpreter -
666instead it will simply initialise the perl interpreter, clean it up and 674instead it will simply initialise the perl interpreter, clean it up and
667exit. 675exit.
668 676
669This means that, by default, it will do nothing but burna few CPU cycles 677This means that, by default, it will do nothing but burn a few CPU cycles
670- for it to do something useful you I<must> add some boot code, e.g. with 678- for it to do something useful you I<must> add some boot code, e.g. with
671the C<--boot> option. 679the C<--boot> option.
672 680
673Example: create a standalone perl binary called F<./myexe> that will 681Example: create a standalone perl binary called F<./myexe> that will
674execute F<appfile> when it is started. 682execute F<appfile> when it is started.

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines