I am tasked to generate standalone perl executables. The structure of the project is like below
--Composition--Input--Modules----tree.pm----log.pm----util.pm--Output--WorkingDir--dpp.pl--rpt.pl
To successfully run dpp.pl, the following command is run
perl dpp.pl '<path_to_project_root>''<path_to_input_dir>''<path_to_working_dir>''I''1'
The following are the use statements in dpp.pl
use strict;use warnings;use feature 'unicode_strings';use lib $ARGV[0] . '/Modules';use FileHandle;use File::Basename;use PerlIO::encoding;use Encode qw(:fallbacks);$PerlIO::encoding::fallback = FB_WARN;use log;use util;use tree;
As you can see during the runtime path to module is passed as an argument.
tree.pm uses the following use statements
require Exporter;@ISA = qw(Exporter);@Export = qw(....)use strict;use warnings;use XML::Simple qw(:strict);use Data::Dumper;use log;
Similarly log.pm uses the following
@ISA = qw(Exporter);@Export = qw(....)use strict;use FileHandle;
And util.pm uses the following
@ISA = qw(Exporter);@Export = qw(....)use strict;use log;use File::Basename;use File::Copy;use File::Find;use File::Path;use Fcntl ':flock';
dpp.pl and rpt.pl are independent and run one after the other. So when I package dpp.pl using pp, I run the following command
pp -o dpp.exe dpp.pl
This generates dpp.exe, but when I run it, I get the error that Simple.pm is not found.
Error log:
Can't locate XML/Simple.pm in @INC (you may need to install the XML::Simple module) (@INC entries checked: E:\<>\Cooperators_DPP\Modules C:\<>\lib C:\<>\inc CODE(0x269fedea700) CODE(0x269fedf0370)) at E:\<>\Modules/tree.pm line 49.BEGIN failed--compilation aborted at E:\<>/tree.pm line 49.Compilation failed in require at script/dpp.pl line 173.BEGIN failed--compilation aborted at script/dpp.pl line 173.
This is the log from the server. And as per conversation, I am not allowed to install XML::Simple module directly on server. After this tried to manually include module explicitly by using pp -M, but it didn't work well, maybe my oversight or a wrong approach. It wrote some files on C:\Windows\TEMP and the client said this should not happen.
This project is something I have just taken over and haven't been given any handover, so I am not sure how previous releases were handled. But please suggest a way to package dpp.pl so that it also includes all the subdependencies, so that client is able to run the exe as it is. And also please suggest if there is anyway to test before submitting to the client? I am a perl noob, so thanks a lot in advance.