Perl PAR PP - Don't work /tmp/par-726f6f74/inc/lib/Mojo/resources/html_entities.txt

358 views Asked by At

I've been using pp

https://metacpan.org/pod/pp

A while ago!

However when hiring another hosting, when I run the pp command the scripts do not run on the server

CentOS Linux release 7.9.2009 (Core) Perl v 5.32.1

Command using pp, host old

$ pp -x -c name.pl

When running

./a.out

Unable to open html entities file (/tmp/par-726f6f74/cache-78cdefedff4d2afddea0035addc3b570c8f0bfd5/inc/lib/Mojo/resources/html_entities.txt): No such file or directory at script / name.pl line 13.
Compilation failed in require at script / name.pl line 13.
BEGIN failed - compilation aborted at script / name.pl line 13.

And when I run ./name.pl it runs normally.

Any suggestion?

name.pl

#!/usr/bin/perl

use FindBin qw($Bin);
use lib ("$Bin");

use DBI;
use Number::Format;
use Encode qw(decode encode);
use File::Basename;
use Mojo::Util qw(b64_encode b64_decode url_escape url_unescape);
use Mojo::JSON qw(decode_json encode_json);
use Image::ExifTool;
use LWP;


print "Test Mojo";

This same command works normally in version 5.28 on another server/hosting

1

There are 1 answers

1
Håkon Hægland On BEST ANSWER

You need to add the file html_entities.txt to the archive. The following seems to work for me:

  • Find the location of the file:

    $ perl -MMojo::Util -MFile::Basename=dirname -E '$fn = (dirname $INC{"Mojo/Util.pm"}) . "/resources/html_entities.txt"; say $fn'
    /home/hakon/perlbrew/perls/perl-5.32.0/lib/site_perl/5.32.0/Mojo/resources/html_entities.txt
    
  • Copy the file to a local directory:

    $ mkdir -p ./lib/Mojo/resources/
    $ cp /home/hakon/perlbrew/perls/perl-5.32.0/lib/site_perl/5.32.0/Mojo/resources/html_entities.txt ./lib/Mojo/resources/
    
  • Add the file to the archive

    $ pp -x -c -a lib/Mojo/resources/html_entities.txt name.pl