1

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

Liandro Cos
  • 65
  • 11

1 Answers1

0

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
    
Håkon Hægland
  • 39,012
  • 21
  • 81
  • 174
  • 2
    [https://github.com/rschupp/PAR-Packer/issues/44](https://github.com/rschupp/PAR-Packer/issues/44) `cpanm git://github.com/rschupp/Module-ScanDeps.git` 100% solved pp -x -c name.pl – Liandro Cos May 14 '21 at 15:21