Supercharge your Perl on Windows

Perl's looking a little long in the tooth these days -- there are so many more exciting languages out there, like PHP, Python and Ruby. But there's still an enormous wealth of programs being written and updated on CPAN, and Perl still excels at the text-based manipulation which it got famous for.

If Perl 6 ever comes out, that may be interesting, although I'm still unsure of the impact of all the syntax and keyword changes. Seems even more complex than before!

On the other hand, I just found out about the PAR-Packer tool, which allows you to easily convert any Perl program into an EXE file. Previously, the only easy method to my knowledge was the proprietary perl2exe tool from IndigoStar.

To get it running, install a Perl distro like IndigoPerl or ActivePerl, ensuring that the version is at least 5.8.6. Then, using PPM (ActiveState) or IPM (IndigoPerl), install these packages:

  • PAR
  • (you may need to add a repository such as Bribes.org)

  • PAR-Packer
  • Archive-Zip
  • Module-ScanDeps
  • Getopt-ArgvFile

and try it out with the following command:

C:\> pp -o hello hello.pl

This should produce a hello.exe file! Check the documentation for more details, but you should be able to achieve pretty good compression by playing around with command-line options.