In my ongoing attempts to use PAR to distribute an application for
both MacOS 10.1 and MacOS 10.2 (which have incompatible shared
libraries) and for users that have installed Perl 5.8 on their
systems, I have switched from using pp to generate a stand-alone
executable to using pp -p and par.pl -b to produce a PAR archive that
I can execute with the local Perl installation. In other words, I am
using this recipie:
Perl with core module installed:
% pp -p source.pl # makes source.par
% par.pl -b -Opacked.pl source.par # makes packed.pl
# Now, deploy 'packed.pl' to target machine...
$ perl packed.pl # run it
I actually do not think this approach will help me because of the
dependency on Compress::Zlib, but I have not yet finished looking into
it. For now, I'm just reporting two minor issues:
1. When I run packed.pl (generated with PAR 0.69), but not when I run
par.pl -b -Opacked.pl, I get:
"Use of uninitialized value in delete at /usr/bin/par.pl line 236."
(BTW, this proves that using the #line directive works and is helpful,
though it took me a moment to realize the message was referring to an
inlined /usr/bin/par.pl and that I was not in fact depending on that
file being installed :-). The offending code is
my $filename = delete $require_list{$module} || do {
my $key;
foreach (keys %require_list) {
next unless /\Q$module\E$/;
$key = $_; last;
}
delete $require_list{$key};
} or return;
I haven't grokked the code enough to figure out why %require_list is
empty here nor whether it is a problem, though packed.pl otherwise
appears to work fine. It's easy enough to add "if defined($key)" to
prevent the error.
2. The first two lines of packed.pl are:
#line 1 "/usr/bin/par.pl"
#!/usr/bin/perl
Perhaps this should be treated as a special case with #!/usr/bin/perl
being put first, before the #line directive, so that packed.pl can be
executed directly from the shell.
Thanks,
Barry