Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid

Mojo pp html_entities.txt

by Anonymous Monk
on Jun 17, 2021 at 16:45 UTC ( #11133963=perlquestion: print w/replies, xml ) Need Help??

Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:

How can I override at run time the directory where Mojo searches for the file "html_entities.txt"? The reason is that I am trying to use PAR pp to create an executable of an application using Mojo on Windows 10, but the exe fails with the following error:

Unable to open html entities file (C:\Users\de\AppData\Local\Temp\par- +6663\cache-9973dd41d00e8bee27c9630746780ae38da71709\inc\lib\Mojo\reso +urces\html_entities.txt): No such file or directory at C:\Users\de\Ap +pData\Local\Temp\par-6663\cache-9973dd41d00e8bee27c9630746780ae38da71 +709\inc\lib/Mojo/ line 14.

I already tried to add to the file explicitly:

-a "C:\Strawberry\perl\vendor\lib\Mojo\resources;Mojo/resources"

with no effect. So probably copying and pasting the file into my data structure and instruct Mojo to search there could be a fix. Any suggestion?

2021-07-09 Athanasius fixed over-long code block.

Replies are listed 'Best First'.
Re: Mojo pp html_entities.txt
by Fletch (Chancellor) on Jun 17, 2021 at 17:59 UTC

    Not exactly a solution but:

    If you look at the code (with something like less $( perldoc -l Mojo::Util )) it's explicitly using the path to Mojo/ and forming the path to that text using the directory that perl source resides in. If you can get PAR to add the resources dir in the packaged lib/Mojo directory it looks like it should find it so I think you're on the right track.

    ## From Mojo/ my $path = File::Spec->catfile(dirname(__FILE__), 'resources', 'html +_entities.txt');

    The cake is a lie.
    The cake is a lie.
    The cake is a lie.

Re: Mojo pp html_entities.txt
by swl (Priest) on Jul 10, 2021 at 00:48 UTC
Re: Mojo pp html_entities.txt
by Anonymous Monk on Jul 09, 2021 at 03:51 UTC

Log In?

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://11133963]
Front-paged by Corion
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others surveying the Monastery: (1)
As of 2021-07-26 02:06 GMT
Find Nodes?
    Voting Booth?

    No recent polls found