App-DataPackUtils

 view release on metacpan or  search on metacpan

script/datapack-modules  view on Meta::CPAN

# Note: This script is a CLI for Riap function /Module/DataPack/datapack_modules
# and generated automatically using Perinci::CmdLine::Gen version 0.496

our $AUTHORITY = 'cpan:PERLANCAR'; # AUTHORITY
our $DATE = '2020-04-30'; # DATE
our $DIST = 'App-DataPackUtils'; # DIST
our $VERSION = '0.06'; # VERSION

use 5.010001;
use strict;
use warnings;

use Perinci::CmdLine::Any;

my $cmdline = Perinci::CmdLine::Any->new(
    url => "/Module/DataPack/datapack_modules",
    program_name => "datapack-modules",
);

$cmdline->run;

# ABSTRACT: Like Module::FatPack, but uses datapacking instead of fatpack
# PODNAME: datapack-modules

__END__

=pod

=encoding UTF-8

=head1 NAME

datapack-modules - Like Module::FatPack, but uses datapacking instead of fatpack

=head1 VERSION

This document describes version 0.06 of datapack-modules (from Perl distribution App-DataPackUtils), released on 2020-04-30.

=head1 SYNOPSIS

Usage:

 % datapack-modules [--config-path=path | -c] [--config-profile=profile |
     -P] [--format=name] [--json] [-m=s+] [--module-name=s+]
     [--module-names-json=s] [--module-src key=s] [--module-srcs-json=s]
     [--(no)naked-res] [--no-config | -C] [--no-env] [--no-overwrite]
     [--no-stripper] [--no-stripper-comment] [--no-stripper-log]
     [--no-stripper-maintain-linum] [--no-stripper-pod] [--no-stripper-ws]
     [--nooverwrite] [--nostripper] [--nostripper-comment]
     [--nostripper-log] [--nostripper-maintain-linum] [--nostripper-pod]
     [--nostripper-ws] [-o=s] [--output=s] [--overwrite]
     [--page-result[=program]] [--postamble=s] [--preamble=s]
     [--put-hook-at-the-end] [--stripper] [--stripper-comment]
     [--stripper-log] [--stripper-maintain-linum] [--stripper-pod]
     [--stripper-ws] [module_name] ...

Examples:

Datapack two modules:

 % datapack-modules Text::Table::Tiny Try::Tiny

=head1 DESCRIPTION

Both this module and C<Module:FatPack> generate source code that embeds modules'
source codes and load them on-demand via require hook. The difference is that
the modules' source codes are put in C<__DATA__> section instead of regular Perl
hashes (fatpack uses C<%fatpacked>). This reduces compilation overhead, although
this is not noticeable unless when the number of embedded modules is quite
large. For example, in C<App::pause>, the C<pause> script embeds ~320 modules with
a total of ~54000 lines. The overhead of fatpack code is ~49ms on my PC, while
with datapack the overhead is about ~10ms.

There are two downsides of this technique. The major one is that you cannot load
modules during BEGIN phase (e.g. using C<use>) because at that point, DATA
section is not yet available. You can only use run-time require()'s.

Another downside of this technique is that you cannot use C<__DATA__> section for
other purposes (well, actually with some care, you still can).

=head1 OPTIONS

C<*> marks required options.

=head2 Main options

=over

=item B<--put-hook-at-the-end>

Put the require hook at the end of @INC using "push" instead of at the front using "unshift".

=back

=head2 Configuration options

=over

=item B<--config-path>=I<s>, B<-c>

Set path to configuration file.

=item B<--config-profile>=I<s>, B<-P>

Set configuration profile to use.

=item B<--no-config>, B<-C>

Do not use any configuration file.

=back

=head2 Environment options

=over

=item B<--no-env>

Do not read environment for default options.

=back



( run in 1.093 second using v1.01-cache-2.11-cpan-39bf76dae61 )