http://www.perlmonks.org?node_id=988847


in reply to Re^2: buildpacked.pl - Pack script and dependencies into self-extracting bash script
in thread buildpacked.pl - Pack script and dependencies into self-extracting bash script

Impressive coding and deft manipulation - nicely done. I downloaded it and tweaked it to actually run (a typo and Dump->Dumper, print Dumper instead of dd, etc) - nicely done indeed.

However, the resulting file from PAR still gives an error when run on another machine:

Can't locate PAR/Heavy.pm in @INC (@INC contains: ...snip...) at /usr/bin/par.pl line 348.

I even attempted to force inclusion of PAR::Heavy by adding push @include, qw(-M PAR::Heavy); after my @include (Admittedly, I gave up after a few moments of it not working - I didn't try *too* hard) - unfortunately, that didn't change the error message on the other machine at all.

Replies are listed 'Best First'.
Re^4: buildpacked.pl - Pack script and dependencies into self-extracting bash script
by Anonymous Monk on Aug 21, 2012 at 20:26 UTC
    Well it does require PAR to be installed on the other machine :/

      Well, I guess that's my nitch use case for this script then :-) I want to generate a portable file that doesn't require any dependencies on the other machine other than the core modules of Perl itself (for some version of perl.) Or is that an unreasonable goal? Or a goal already covered by some other script/program I'm as yet unaware of? Cheers!

        Or is that an unreasonable goal? Or a goal already covered by some other script/program I'm as yet unaware of? Cheers!

        In that case I think it is App::FatPacker - pack your dependencies onto your script file

        http://cpanmin.us uses it