Herong's Tutorial Notes on Perl - Part A
Dr. Herong Yang, Version 4.09

Converting Perl Scripts to Executables

Part:   1   2 

This chapter describes:

  • Why we need to convert Perl scripts to executable programs.
  • How to install Perl Dev Kit and use it to convert Perl scripts.

Why Converting Perl Scripts to Executables

It happens very often that you have developed a very nice Perl script to perform a common task, and someone else also need to perform this task. So you decide to share your script with him/her. But he/she knows nothing about Perl and does not have Perl installed on his/her system. The simplest way to share your script in this case is to convert it into an executable program.

There are two general approaches to convert Perl scripts into executable programs:

  • Using the standard Perl compilation tool, perlcc, to convert Perl scripts into C source codes and then compiled into executable programs.
  • Using "Perl Dev Kit (PDK)" from ActiveState to convert Perl scripts directly into Windows executable programs.

Installing Perl Dev Kit (PDK)

Since I have ActivePerl from ActiveState installed on my machine, I am going to try Perl Dev Kit (PDK) from ActiveState. Note that PDK is not a freeware like ActivePerl. But it offers a 21-day trial license. Here is how I installed PDK on my system:

1. Go to http://www.activestate.com/Products/Perl_Dev_Kit/ and download PDK-Deployment-6.0.1.138990.msi. The file is about 6 MB.

2. Double click on PDK-Deployment-6.0.1.138990.msi to install it to a directory called: \pdk.

3. To try it, run the perlapp in a command window as:

>\pdk\bin\perlapp -help

You don't seem to have a valid license.
Please purchase a license from http://www.ActiveState.com/PDK

4. Ok, now go back to http://www.activestate.com/Products/Perl_Dev_Kit/ and click the "Try" button. You need to fill in a form to register yourself for a trial license key.

5. After submitting the form, I got an email with a download link. So I followed the link and downloaded a file called: T20ABCC9A1-PLDK60T-1466.exe.

6. Double click on T20ABCC9A1-PLDK60T-1466.exe to install the 21-day trial license.

7. Run the perlapp again:

>\pdk\bin\perlapp -help

NAME
    perlapp - Convert Perl program into a standalone application

SYNOPSIS	
...

Very cool, I got PDK running on my system.

(Continued on next part...)

Part:   1   2 

Dr. Herong Yang, updated in 2006
Herong's Tutorial Notes on Perl - Part A - Converting Perl Scripts to Executables