Deploying Perl apps

I usually code my perl programs on a development machine, and then ty to make in run in the production environment.

I used to manage by myself the various needed packages and tried to have them installed on the production environment as needed.

And one day I had to make a script run on a machine where Perl itself was not even installed…

This has been a nightmare until recently, that is to say until I discovered the PAR module. PAR is closed to the Java JAR files.

Once you have the PAR package installed, you have a set of helper scripts installed as well. Having you script run somewhere else is then as simple as :

pp -o app app.pl (you might want to do pp -o app.exe app.pl if you’re on Windows)

This script will analyze the script, gather all the dependencies (“all” including the Perl binary, used modules and DLLs), and build a self extractible archive which will unpack and execute your script when run.

Simple ? 🙂