<?xml version="1.0" encoding="windows-1252"?>
<node id="1007336" title="Bug in App::FatPacker?" created="2012-12-05 11:58:52" updated="2012-12-05 11:58:52">
<type id="115">
perlquestion</type>
<author id="846903">
elef</author>
<data>
<field name="doctext">
I'm trying to pack some modules with App::FatPacker on a Ubuntu 12.4 VM with perl 5.14.2, and I'm running into what looks like a bug in the module.&lt;p&gt;
The first command in the fatpacker synopsis (fatpack trace myscript.pl) runs without error. When I run &lt;c&gt;fatpack packlists-for `cat fatpacker.trace` &gt;packlists&lt;/c&gt;, I get the following error message: &lt;c&gt;Use of uninitialized value $_ in hash element at /usr/local/share/perl/5.14.2/App/FatPacker.pm line 110, &lt;&gt; line 42.&lt;/c&gt;
&lt;p&gt;
Line 110 of FatPacker.pm is this:
&lt;c&gt;my %found; @found{map +($pack_rev{$INC{$_}}||()), @targets} = ();&lt;/c&gt;
&lt;p&gt;
It's part of this sub:
&lt;c&gt;sub packlists_containing {
  my ($self, $targets) = @_;
  my @targets = @$targets;
  require $_ for @targets;
  my @search = grep -d $_, map catdir($_, 'auto'), @INC;
  my %pack_rev;
  my $cwd = cwd;
  find(sub {
    return unless $_ eq '.packlist' &amp;&amp; -f $_;
    $pack_rev{$_} = $File::Find::name for lines_of $File::Find::name;
  }, @search);
  chdir($cwd) or die "Couldn't chdir back to ${cwd} after find: $!";
  my %found; @found{map +($pack_rev{$INC{$_}}||()), @targets} = ();
  sort keys %found;
}
&lt;/c&gt;
This is just too tricky for me to troubleshoot. Should I install an earlier version of Ubuntu (years ago, I managed to get App::FatPacker to work on Ubuntu 8.04)?
&lt;p&gt;
EDIT:
&lt;p&gt;
I did some further testing. A test script that does not load any CPAN modules was processed by fatpacker without errors. The packed script was generated correctly.
&lt;p&gt;
The actual script I need to process loads Spreadsheet::WriteExcel and Spreadsheet::ParseExcel::Simple, so these are the two modules fatpacker would need to inline.
&lt;p&gt;
The fatpacker.trace file is as follows:
&lt;c&gt;
POSIX.pm
List/Util.pm
Spreadsheet/ParseExcel/Cell.pm
/usr/lib/perl/5.14/auto/POSIX/load_imports.al
Tie/Hash.pm
Cwd.pm
Spreadsheet/WriteExcel/OLEwriter.pm
Spreadsheet/ParseExcel.pm
Fcntl.pm
Symbol.pm
Spreadsheet/WriteExcel/Chart.pm
Scalar/Util.pm
Spreadsheet/ParseExcel/Format.pm
Spreadsheet/WriteExcel/BIFFwriter.pm
File/Spec.pm
File/Glob.pm
warnings/register.pm
Spreadsheet/ParseExcel/Workbook.pm
Spreadsheet/ParseExcel/Utility.pm
Spreadsheet/WriteExcel/Properties.pm
utf8.pm
Spreadsheet/WriteExcel/Worksheet.pm
File/Spec/Unix.pm
Exporter/Heavy.pm
vars.pm
Spreadsheet/WriteExcel/Formula.pm
Spreadsheet/WriteExcel/Workbook.pm
AutoLoader.pm
IO/Handle.pm
Getopt/Long.pm
SelectSaver.pm
Spreadsheet/ParseExcel/Worksheet.pm
Time/Local.pm
Spreadsheet/ParseExcel/Font.pm
unicore/Heavy.pl
unicore/To/Fold.pl
Spreadsheet/WriteExcel.pm
/usr/lib/perl/5.14/auto/POSIX/autosplit.ix
OLE/Storage_Lite.pm
FindBin.pm
IO/Seekable.pm
File/Copy.pm
Spreadsheet/WriteExcel/Format.pm
threads.pm
Digest/Perl/MD5.pm
File/Basename.pm
Config.pm
integer.pm
IO.pm
if.pm
Carp.pm
Crypt/RC4.pm
FileHandle.pm
Spreadsheet/ParseExcel/Simple.pm
utf8_heavy.pl
constant.pm
Spreadsheet/ParseExcel/FmtDefault.pm
overload.pm
IO/File.pm
feature.pm
&lt;/c&gt;
</field>
</data>
</node>
