Perl is a free and mature scripting language, created by Larry Wall. It is used as glue language for some of the hugin and libpano functionalities. Phil Harvey’s Exiftool, required by hugin, is also written in Perl.
Perl lends itself well for cross-platform scripting because it comes installed by default with most operating systems. Not with Windows. To work around Window’s limitation Steffen Müller maintains pp, a tool originally developed by Audrey Tang that creates standalone executables from Perl programs.
If you are just a Windows user, you can simply be thankful to Steffen and the PAR::Packer community for enabling developers and builders to supply you with a simple solution to run the software on your Windows box.
And if you are interested to know how to build those executables, read on this tutorial which I’ve put together with help from the PAR::Packer community, particularly Mark Dootson.
Infrastructure to build Windows executable from Perl scripts
This is highly experimental. it has been tested on PAR::Packer 0.980 released May 14, 2008.
Install MinGW – MSVC 2008 EE is not supported
- Download MinGW-5.1.4.exe from the MinGW homepage.
- Follow the default install (click all the “Yes” and “Next” buttons), but add g++ to the mix, i.e. on the screen where you can tick boxes to choose what to install, check the box with g++ (and leave anything else as is). It will be installed in C:\MinGW
- Run the now installed C:\MinGW\MinGW-5.1.4.exe from the command line to ensure you get the latest updates.
Install ActiveState Perl 5.10.0 build 1002 (The free version is enough. Other/newer versions may also work, this is the one that worked for me).
- Get-opt-ArgvFile (>=1.07)
- module-scandeps (>=0.78)
- par-dist (>=0.22)
- parse-binary (>=0.10)
Extract dmake to C:\MinGW so that you have a folder called C:\MinGW\dmake
Make yourself an environment batch file, call it perl.bat, with the following content. Use it to start the command line interface (CLI) with a double click.
set MINGW_PATH=C:\MinGW set PERL_PATH=C:\Perl set PATH=%MINGW_PATH%\bin;%MINGW_PATH%\mingw32\bin;%MINGW_PATH%\dmake; set PATH=%PATH%C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\system32\WBEM; set LIB=%MINGW_PATH%\lib; set INCLUDE=%MINGW_PATH%\include; set PATH=%PERL_PATH%\site\bin;%PERL_PATH%\bin;%PATH% cmd /K
- Download the archives and extract them to temporary folders
- doubleclick on perl.bat to start a CLI
- in the CLI, run the following commandsinside each of the temporary folders
> perl Makefile.PL > dmake > dmake test > dmake install
test your installation
create a file test.pl with the following content:
#!/usr/bin/perl print "hello world!\n";
in the CLI, check that it works
> perl test.pl
> pp -o test.exe test.pl
here you go, ready to build your perl scripts into Windows executables!