0

I have a perl script on a linux system that I would like to compile to generate an executable that runs natively on Windows. I would like to do this with free software, preferably Perl PAR / pp. Is this possible?

2
  • Have you even tried with PAR? Commented Jan 9, 2012 at 4:01
  • Hi Xavier. I tried PAR (pp), but the executable only works on Linux. Commented Jan 9, 2012 at 4:18

1 Answer 1

3

You need to run pp on a windows machine to make a windows binary. I know it works, I've done it. Any Linux specific code will need to be made at least platform-independent or windows specific, but Perl is a generally platform independent language. Using File::Spec will help.

Sign up to request clarification or add additional context in comments.

8 Comments

Thanks @JoelBerger. I downloaded ActiveState perl on windows and downloaded the PAR module, but don't have the pp utility.
Try installing PAR::Packer too. Personally I would try the Strawberry Perl distribution rather than AS. AS uses PPM which is less like Linux-based module installation. Strawberry Perl uses a system which contains a Unix-like build system, therefore much closer to a Linux-esque system.
Also you might cheat and install PAR with PPM, but use cpan PAR::Packer at the command prompt to install pp. I believe that it is pure Perl so that should work. IIRC this is what I did to make it work
@Joel Berger, AS provides the same build env as Strawberry in addition to ppm. AS released it's 5.14 build mere days after 5.14 came out (if not the day of), and Strawberry still doesn't have a 5.14 build after 7 months (although it appears they have a beta build of it finally).
@Joel Berger, I try not to use distro perl. (perlbrew ftw) If I use the distro perl, I use the distro installer.
|

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.