Reputation: 1848
I have a perfectly functioning perl script (written in bash terminal on debian linux) that fails to execute (on either linux or windows) when compiled using pp
. This may relate to unmet dependencies in the build, but I do believe the following command packages all dependencies into the executable:
pp -o out.exe in.pl
When I say it is perfectly functioning, I mean that the intended output is generated with no errors if I invoke ./in.pl
from a bash terminal.
I would like to create an executable that will run on either linux or windows (if a separate file is required for each OS, so be it).
These are the packages that are included in the source:
use strict;
use warnings;
use charnames ":short";
binmode(STDOUT,":utf8");
use Term::ANSIColor;
use Number::Format;
use Finance::Quote;
use Finance::QuoteHist;
use Date::Manip; # this may be included by Finance::QuoteHist
If it helps, here is the error message I get (warning, it's long):
ERROR: [config_var] invalid zone in SetDate
ERROR: [config_var] invalid zone in SetDate
Could not load either Text::CSV_XS or Text::CSV_PP : Can't locate Text/CSV_PP.pm in @INC (@INC contains: CODE(0x1422320) /tmp/par-username/cache-addd1cc2ee9285c150584c1853c2b67c0c482e7e/inc/lib /tmp/par-username/cache-addd1cc2ee9285c150584c1853c2b67c0c482e7e/inc CODE(0x11675b0) CODE(0x116ebc8)) at (eval 30) line 2.
BEGIN failed--compilation aborted at (eval 30) line 2.
at Finance/QuoteHist.pm line 13
Compilation failed in require at Finance/QuoteHist.pm line 13.
BEGIN failed--compilation aborted at Finance/QuoteHist.pm line 13.
Compilation failed in require at script/in.pl line 10.
BEGIN failed--compilation aborted at script/in.pl line 10.
Judging from the run-time errors, the problem may relate to unmet recursive dependencies (for instance, dependencies within Finance::QuoteHist). Perhaps these recursive dependencies should be included explicitly? This is my first time attempting to compile perl into an executable, so thanks for any guidance you can provide.
Upvotes: 0
Views: 1004
Reputation: 20280
You might try to use the -x
flag to pp
as seen in the docs. It runs the script and checks for dependencies as it goes, which is more accurate than simply scanning for dependencies. I have needed this when using Tk
and it worked wonders.
Upvotes: 3