… | |
… | |
382 | =over 4 |
382 | =over 4 |
383 | |
383 | |
384 | =item C<--use> F<module> | C<-M>F<module> |
384 | =item C<--use> F<module> | C<-M>F<module> |
385 | |
385 | |
386 | Include the named module and trace direct dependencies. This is done by |
386 | Include the named module and trace direct dependencies. This is done by |
387 | C<require>'ing the module in a subprocess and tracing which other modules |
387 | C<use>'ing the module from a fresh package in a subprocess and tracing |
388 | and files it actually loads. |
388 | which other modules and files it actually loads. |
389 | |
389 | |
390 | Example: include AnyEvent and AnyEvent::Impl::Perl. |
390 | Example: include AnyEvent and AnyEvent::Impl::Perl. |
391 | |
391 | |
392 | staticperl mkbundle --use AnyEvent --use AnyEvent::Impl::Perl |
392 | staticperl mkbundle --use AnyEvent --use AnyEvent::Impl::Perl |
393 | |
393 | |
… | |
… | |
420 | code, or maybe one of the modules you use need a special use statement. In |
420 | code, or maybe one of the modules you use need a special use statement. In |
421 | that case, you can use C<--eval> to execute some perl snippet or set some |
421 | that case, you can use C<--eval> to execute some perl snippet or set some |
422 | variables or whatever you need. All files C<require>'d or C<use>'d while |
422 | variables or whatever you need. All files C<require>'d or C<use>'d while |
423 | executing the snippet are included in the final bundle. |
423 | executing the snippet are included in the final bundle. |
424 | |
424 | |
425 | Keep in mind that F<mkbundle> will only C<require> the modules named |
425 | Keep in mind that F<mkbundle> will not import any symbols from the modules |
426 | by the C<--use> option, so do not expect the symbols from modules you |
426 | named by the C<--use> option, so do not expect the symbols from modules |
427 | C<--use>'d earlier on the command line to be available. |
427 | you C<--use>'d earlier on the command line to be available. |
428 | |
428 | |
429 | Example: force L<AnyEvent> to detect a backend and therefore include it |
429 | Example: force L<AnyEvent> to detect a backend and therefore include it |
430 | in the final bundle. |
430 | in the final bundle. |
431 | |
431 | |
432 | staticperl mkbundle --eval 'use AnyEvent; AnyEvent::detect' |
432 | staticperl mkbundle --eval 'use AnyEvent; AnyEvent::detect' |