Is it possible to build a single executable Perl program that will run on a variety of platforms?

StackOverflow https://stackoverflow.com/questions/7408436

  •  29-10-2019
  •  | 
  •  

Question

I have a Perl script that I've written and can compile it using pp (PAR). I'm curious if it's possible to make a single executable that is completely portable (run on linux & windows) or do I have to create 2 executables (one for linux and one for windows). I'm not interested in options using perlapp or perl2exe, I'm strictly looking for a PAR/pp option here. Also I'm not looking for PAR's capability to create a .par file and have a stub Perl environment pre-deployed for the OS varieties.

EDIT:

When running the file command against a binary built on my linux system it shows the binary is of the following type:

% file my_app
my_app: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.32, stripped.

This would seem to indicate that it will only run on a linux system.

No correct solution

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top