I have a script that starts like this:
use strict;
use feature 'say';
use warnings FATAL => 'all';
use autodie ':default';
use Term::ANSIColor;
use Cwd 'getcwd';
use SimpleFlow qw(task say2);
use Getopt::ArgParse;
use File::Basename;
use POSIX 'strftime';
use File::Temp 'tempfile';
use Scalar::Util qw(looks_like_number);
use List::Util qw(min max sum);
which runs fine in Perl 5.42
I am attempting to create a standalone executable on Linux, so that the Perl version and all relevant modules are included, so that there is no additional installation required.
I've been using PAR::Packer which is pp, but it's not working:
pp -I /home/con/perl5/perlbrew/perls/perl-5.42.0/lib/5.42.0/ -o x.pepPriML x.pepPriML.pl
which outputs:
Built-in function 'builtin::blessed' is experimental at /home/con/perl5/perlbrew/perls/perl-5.42.0/lib/5.42.0/overload.pm line 103.
Perl v5.40.0 required--this is only v5.38.2, stopped at /home/con/perl5/perlbrew/perls/perl-5.42.0/lib/5.42.0/builtin.pm line 3.
BEGIN failed--compilation aborted at /home/con/perl5/perlbrew/perls/perl-5.42.0/lib/5.42.0/builtin.pm line 3.
Compilation failed in require at /home/con/perl5/perlbrew/perls/perl-5.42.0/lib/5.42.0/File/Copy.pm line 14.
BEGIN failed--compilation aborted at /home/con/perl5/perlbrew/perls/perl-5.42.0/lib/5.42.0/File/Copy.pm line 14.
Compilation failed in require at /usr/share/perl5/Archive/Zip/Archive.pm line 9.
BEGIN failed--compilation aborted at /usr/share/perl5/Archive/Zip/Archive.pm line 9.
Compilation failed in require at /usr/share/perl5/Archive/Zip.pm line 316.
Compilation failed in require at -e line 236.
Failed to execute temporary parl (class PAR::StrippedPARL::Static) '/tmp/parl1X6c': $?=65280 at /usr/share/perl5/PAR/StrippedPARL/Base.pm line 77, line 1.
/usr/bin/pp: Failed to extract a parl from 'PAR::StrippedPARL::Static' to file '/tmp/parlHjpr_2o' at /usr/share/perl5/PAR/Packer.pm line 1216, line 1.
even when I specify perl 5.0382 within the script, it cannot compile with pp
How can I create a standalone executable to have all libraries included with the Perl version?