I'm having a lot of trouble with compiling my perl script. I'm using all sorts of modules in my script:
use fetchinfo; #which I wrote so it's in the same directory as my script
use threads;
use threads::shared;
use Tk;
use Fcntl ':flock';
And fetchinfo.pm also uses this modules:
use WWW::Mechanize;
use URI::Escape;
use Date::Calc qw(Delta_Days);
use LWP::Simple;
use HTML::Parser;
I got ActivePerl installed on my machine (64-bit Win 7).
I'm trying to compile my code and make it an independent .exe file (although it would be great to be able to compile for other systems too (since I think my code doesn't use any system specific functions).
I don't mind installing a virtual machine (if 32-bit win is required or linux), I don't mind installing Strawberry perl instead of ActivePerl... I just want to be able to compile the code :-)
trying to use perl2EXE it said it can't find a few of the modules (although everyone of those were installed by ppm). I tried compiling on linux with Perl Packager (PAR::Packer) (Since it doesn't show on ppm and I had trouble installing it any other way) but the file which got created didn't work.
... help? :-)
Are you aware that all
perl2exedoes is to create a copy of the perl interpreter executable that includes all your source files (possibly in a compiled state, I'm not sure)?I recommend that you use the
PAR packageinstead, which will build a single archive file containing all the necessary sources that can be run from theperlcommand line.If you absolutely must have a single executable image, then look at
PAR::Packerinstead.Update
No, you don't have to compile Perl source to put it into a package. It is counter-productive to do so as load times tend to increase due to the extra
ByteLoadermodule necessary to interpret the resulting parse tree.I don't have an instance of ActivePerl, but
Par::Packerinstalls fine on Strawberry Perl 5 version 16.2 and passes all tests. Please understand that you cannot build an executable on one system that will run on a different platform. This applies to every language, not just Perl. You need working version of Perl on a system compatible with your target to be able to build an executable that will work elsewhere.