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

I've been working on this for several months off and on, have read 40+ sites from Google searches, and I'm still stumped. I don't care what type of Perl I use, but Strawberry Perl and ActiveState just doesn't work for me to make an exe file from my perl code. I only need the EXE file made to work on Windows, I don't care which OS or Perl makes it.

pp and PAR::Packer cannot be installed on Strawberry Perl 5.18.2. It just doesn't work. I tried with cpanm, cpan, and ppm. It fails on all accounts.

The default Par::Packer from cpan that is gotten is 1.27, though the most recent version on CPAN says, as of yesterday, 1.28. I don't know why.

pp doesn't seem to install with most versions of Strawberry perl. PP has been broken for years with SP.

ActiveState perl has a lot of older modules, and some handy modules just aren't in their repo. So I can't use ActiveState.

Perl2exe doesn't work with any version of Strawberry perl. I already contacted their tech support.

I don't need to hide code, I just need to make an EXE file for a DOS box so people don't have to install perl, and can use my program.

I'm looking into CitrusPerl and Cava for Windows but I don't know how to find modules Citrus Perl has. ActiveState and Strawberry Perl both seem to have their own repos, so I assume Citrus also does. EDIT: Cava only works with perl 5.14 and some earlier versions. Has anyone tested Cava with Strawberry perl 5.14? How about SP 5.18.2?

So what are my options? Can I make a windows CLI exe file on Ubuntu perl?

Of course, you could write out bytes that represent a windows executable, from almost any version of perl running on almost any operating system.

But wrapping a perl script, its requirements, and a perl interpreter into a Windows executable will most likely work only on Windows (simply because you neither have a windows based Perl interpreter on Ubuntu, nor you have the required compiler to compile XS modules for Windows). And even there, it's a bad idea. Better bundle perl (e.g. Strawberry) and your script and install that using an installer package like InnoSetup.

Alexander

--
Today I will gladly share my knowledge and experience, for there are no sweeter words than "I told you so". ;-)

But wrapping a perl script, its requirements, and a perl interpreter into a Windows executable will most likely work only on Windows

I don't care on what OS the EXE is made on, I just need to make an EXE that works on Windows only. My problem, is so far, no Perl for Windows can make an EXE for me yet, for various reasons explained above.

•pp and PAR::Packer cannot be installed on Strawberry Perl 5.18.2. It just doesn't work. I tried with cpanm, cpan, and ppm. It fails on all accounts.

What errors do you see when you tried with cpan?

•The default Par::Packer from cpan that is gotten is 1.27, though the most recent version on CPAN says, as of yesterday, 1.28. I don't know why.

I downloaded the 1.28 version of PAR::Packer just now and transferred it to a server that is not web connected and installed it using dmake. It works. It's on Windows Server 2008 with Strawberry Perl 5.16.2 64 bit. I had to upgrade PAR to 1.010, 5.16.2 comes with a slightly older version. There were only a couple of other modules that I had to install. Getopt::ArgvFile and Module::ScanDeps. I already had Test::Requires.

•pp doesn't seem to install with most versions of Strawberry perl. PP has been broken for years with SP.

My workstation runs Windows 7 and has Strawberry Perl 5.18.2 installed. I just tested pp and it works. To see which version I have and what is available I opened the interactive cpan client from the command line and then did the following.

You should check out the Perl Dev Kit. I have the latest PDK and it works lovely. You can also script GUI's and pack them with PDK as well. I have a multi-tool going and its all scripted in perl and packed with PDK.

EDIT: Also I should add that I am running Active State Perl version 5.16.3 and the latest PDK. Ive also noticed alot of modules are not readily available for the newer versions of AS Perl, which is why I stay on 5.16.3.

EDIT 2: Also, even with AS Perl, I install many modules from CPAN. and also with AS PPM you can add more repos as well.

Assuming you have a Windows platform available, I've been successful with just downloading a version of Strawberry Perl Portable to compile exe's using PAR::Packer. Just unzip to a directory, double-click on the portableshell batch file, install your needed modules in that CPAN, and see if that works for you.