App-FatPacker

 view release on metacpan or  search on metacpan

Changes  view on Meta::CPAN


0.009011 - 2012-09-24
  - RT #79835: install bin/fatpack (lost in 0.009009 in the
    Module::Install -> Distar conversion)

0.009010 - 2012-09-19
  - enable temp file deletion in pack.t on Win32
  - RT #79489: %fatpacked keys need to be unix paths

0.009009 - 2012-08-03
  - RT #78724: fix trace --to-stderr (ether)

0.009008 - 2012-07-16
  - RT #78391: Avoid using $_ when requiring modules

0.009007 - 2012-07-12
  - Allow capturing of trace information into return value
  - Add repsoitory metadata to META.YML

0.009006 - 2011-01-18
  - Use File::Path's "legacy" mkpath and rmtree functions. No longer needs

bin/fatpack  view on Meta::CPAN


  $ fatpack pack myscript.pl > myscript.packed.pl

A shortcut to do all the work of tracing, collecting packlists,
extracting modules in fatlib, then concatenating into a packed script
- in one shot. If you need more detailed controls for additional
modules, use the following commands separately (see L</RECIPES>).

=head2 trace

  $ fatpack trace [--to=trace-file|--to-stderr] [--use=MODULE]
      myscript.pl

Compiles myscript.pl (as in "perl -c") and writes out a trace file containing
every module require()d during the compilation.

The trace file is called 'fatpacker.trace' by default; the --to option
overrides this.

If you pass --to-stderr fatpack writes the trace to STDERR instead.

You cannot pass both --to and --to-stderr.

If the --use option specifies a module (or modules, if used multiple
times) those modules will be additionally included in the trace output.

=head2 packlists-for

  $ fatpack packlists-for Module1 Module2 Module3

Searches your perl's @INC for .packlist files containing the .pm files for
the modules requested and emits a list of unique packlist files to STDOUT.

lib/App/FatPacker.pm  view on Meta::CPAN


  my $file = shift @$args;
  print $self->fatpack_file($file);
}

sub script_command_trace {
  my ($self, $args) = @_;

  $args = $self->call_parser($args => [
    'to=s' => \my $file,
    'to-stderr' => \my $to_stderr,
    'use=s' => \my @additional_use
  ]);

  die "Can't use to and to-stderr on same call" if $file && $to_stderr;

  $file ||= 'fatpacker.trace';

  if (!$to_stderr and -e $file) {
    unlink $file or die "Couldn't remove old trace file: $!";
  }
  my $arg = do {
    if ($to_stderr) {
      ">&STDERR"
    } elsif ($file) {
      ">>${file}"
    }
  };

  $self->trace(
    use => \@additional_use,
    args => $args,
    output => $arg,



( run in 0.598 second using v1.01-cache-2.11-cpan-a9ef4e587e4 )