Perl2Exe User Manual


CONTENTS

About This Program
System Requirements
Installation
Release History
Contacting the Author
License Agreement


About This Program

Perl2Exe is a command line utility for converting perl scripts to EXE files.

Usage:

"perl2exe myscript"

This will convert myscript.pl to myscript.exe

options:

-perloptions
Sets the options used to invoke the perl interpreter. If several options are used put them in quotes, e.g.: -perloptions="-s -p". Default is -s. For no options use: -perloptions=none

-register

This option allow you to enter registration information for Perl2Exe. You will be prompted for a registration key.

-small

Generates a smaller executable which uses a shared runtime DLL. The generated executable will be smaller by about 500KB. The executable will require a shared DLL, p2xdll.dll, to run. This DLL will be copied to the current directory.

-tiny

Create an even smaller executable by placing additional code into DLL's. Perl2Exe will create DLL files in the current directory containing code from loadable modules which use .pll files. This option is only available in the trial and Pro versions of Perl2Exe.

 

Notes and FAQ's:

1.Perl2exe is compatible with "Perl, version 5.003_07, Perl for Win32 Build 316"

2. Perl2Exe performance
Programs created with Perl2Exe will run at the same speed as perl scripts run with the standard interpreter.

3. Command line options
When we invoke perl on your script, it is equivalent to running with the perl -s option. So the command line:
myscript -opt1=My_Name
is equivalent to:
perl -s script.pl -opt1=My_Name
This will set $opt1="My_Name", i.e. the variable is already set, and you don't have to do any parsing of command line parameters. You can override the -s flag by using the -perloptions options

4. Building exe for scripts containing the glob function
If your script contains the glob function ( e.g. $foo = <*.*> ), you must bind PerlGlob.exe into you exe as follows:
perl2exe myscript.pl c:\perl\bin\perlglob.exe
The above line assumes that standard Perl is installed in c:\perl

5. Using the system( ) function
Most system() function calls require no special handling. However if your system call uses io redirection or pipes them you will need to add cmd32.exe to your executable. Bind cmd32.exe into your exe as follows:
perl2exe myscript.pl c:\perl\bin\perlglob.exe
The above line assumes that standard Perl is installed in c:\perl. An alternative to binding cmd32.exe into your exe is to ship cmd32.exe with your exe file.

The following examples require no special handling:
system("cls"); system("dir"); system("net use");

The following examples require cmd32.exe:
system("net use >foo"); system("date <cr.dat"); system("dir | more");

As an altenative to using cmd32.exe consider using the back-tick method of running a program. Example: instead of system("net use >foo"); use $foo = `net use`; print OUT $foo;

5. Building exe files for scripts containing "use" or "require" statements
Perl2Exe will automatically scan your source code for use and require statements. Required source modules modules (".pm" files) and autoloadable (".pll" files) will be automatically complied into you exe file. In order for this to work the standard Perl interpreter's bin directory must be in your path (e.g. c:\perl\bin)

Another requirement is that you must use "Perl, version 5.003_07, Perl for Win32 Build 316". If you are using a different version of Perl, here is what you have to do:

a) Download Perl "Perl for Win32 Build 316" from http://www.activestate.com or from our website. Unzip it to a directory like C:\PERL316, by running it. When you run it it will ask if you wish to run the install batch file after unzipping it. If you wish to keep your other version of Perl, then there is no need to run the install program. Otherwise run the install program.

b) Place bin directory is in your path. E.g. C:\PERL316\BIN

c) Add any additional non standard modules to the new perl directory. E.g.
C:\PERL316\lib\win32\internet.pm,
C:\PERL316\lib\auto\win32\internet\internet.pll etc.

d) Compile your program with Perl2Exe.

6. "Can't locate somemodule.pm in @INC at myscript.pl line 1" error message
If you get an error message like the one above, you can force the missing module to be compiled into the exe with the command: "perl2exe myscript \somepath\somemodule.pm". Please also send us the script with this problem, so we can fix the problem in a future version of Perl2Exe.

8. Using dbmopen
If your script contains a dbmopen function call, add the following two lines to your script.
use AnyDBM_File;
use SDBM_File;

9. Contacting us for support
If you are having trouble getting your script to run, please send us the following information:
The output of Perl2exe
The output of your script
The script
Any data files, etc. required by the script.
Any non standard modules (.pm and .pll files) requires by your script.

You can save the output of perl2exe, and your program to a file with the commands:
perl2exe myscript >foo.txt
myscript >>foo.txt

You should strip the script down to the minimum needed to to reproduce the problem.

 


System Requirements

Windows 95, or Windows NT


Installation

Unzip the installation file, and copy the files to the perl\bin directory , or any directory that is in your path, or place it in the current directory.

If you have a registration key for Perl2Exe, start perl2exe with the command:
perl2exe -register
This option allow you to enter registration information for Perl2Exe. You will be prompted for a registration key.

Perl2Exe no longer requires a modified version of dynaloader.pm. If you have the file from an earlier installation, it should be removed.


Release History

V2.170-316 Mar 21, 1998
Rebuild for Perl Perl 5.003_07 Build 316
Bug fix: Get runtime error when modifying an environment variable
Bug fix: wildcards not expanded on command line arguments
Bug fix: Exe fails if filename is mixed case, eg "perl2exe Sample"
Bug Fix: Some system calls not working (see notes)
Documentation: dbmopen requires the addition of use AnyDBM_File; use SDBM_File;

V2.16.2-315 Feb 25,1998
Fixed bug where $foo = <IN> would cause runtime error with -small option

V2.16-315 Feb 9,1998
Enhancements to the -small option
Added -tiny option

V2.15-315 Feb 7,1998
Rebuild for Perl Perl 5.003_07 Build 315

V2.14-313 Feb 1,98
Introduced Pro and Lite versions of Perl2Exe
Added -small option
Removed need for special dynaloader.pm file

V2.13-313 Jan 1,98
Fixed serious error which sometimes causes a GP fault when running generated exe from NT command line, or a "parse exception" when run from IIS.

V2.12-313 Dec 4,97
Rebuild for Perl Perl 5.003_07 Build 313
Handle require "foobar.pl"; syntax
Handle conflict between Socket and IO::Socket
Socket i/o now works.

V2.11-310 Nov 5,97
Minor documentation cleanup.
Handle "use foobar;" where there is a double space between use and foobar.

V2.11 Oct 16,97
Fixed error when exe containing dynamically loaded modules files is executed as a cgi script.
Print error message if Dynaloader.pm is missing from Perl2Exe directory

V2.10 Oct 13,97
Rebuild for Perl Perl 5.003_07 Build 310
Documentation is now in HTML.
Misleading error message references to temp directory cleaned up
Standalone improvements. Exe file can now be tested on PC, even if Perl is installed on it.

V2.04
Base line version for Perl 5..003_07 Build 306

V1.0
Original version

 


Contacting the Author

We'd like to hear your questions and comments! You can reach us at:

Internet Email: info@demobuilder.com
WWW: http://www.demobuilder.com

 


Ordering Information

For ordering information please visit our Web page.

 


LICENSE AGREEMENT

You should carefully read the following terms and conditions before using this software. Unless you have a different license agreement signed by Mercury Systems, your use of this software indicates your acceptance of this license agreement and warranty.

Registered Version

Each registered copy of Perl2Exe may be used at a single workstation to create an unlimited number of exe files, subject to the following conditions:

* A separate registered copy of Perl2Exe must be obtained for each workstation on which Perl2Exe will be used even if such use is only temporary. This is not a "concurrent use" license.

* Exe files created by Perl2Exe are shipped with Run-time portions of Perl2Exe. No registered user, nor anyone else, may alter or modify the generated Exe files. You cannot give anyone else permission to modify the Exe files.

* Exe files generated by the registered version of Perl2exe may be freely distributed.

All rights not expressly granted in this license agreement are reserved entirely to Mercury Systems

Governing Law

This agreement shall be governed by the laws of the Province of Ontario, Canada.

Disclaimer of Warranty

THIS SOFTWARE AND THE ACCOMPANYING FILES ARE SOLD "AS IS" AND WITHOUT WARRANTIES AS TO PERFORMANCE OF MERCHANTABILITY OR ANY OTHER WARRANTIES WHETHER EXPRESSED OR IMPLIED. Because of the various hardware and software environments into which Perl2Exe may be put, NO WARRANTY OF FITNESS FOR A PARTICULAR PURPOSE IS OFFERED. Good data processing procedure dictates that any program be thoroughly tested with non-critical data before relying on it. The user must assume the entire risk of using the program. ANY LIABILITY OF THE SELLER WILL BE LIMITED EXCLUSIVELY TO PRODUCT REPLACEMENT OR REFUND OF PURCHASE PRICE.

Shareware Version

This is not free software. You are hereby licensed to use the shareware evaluation version of Perl2Exe for evaluation purposes without charge for a period of 30 days. If you use this software after the 30 day evaluation period a registration fee is required. Under no circumstances are you licensed to distribute Exe files created by the shareware evaluation version of Perl2Exe. Unregistered use of Perl2Exe after the 30 day
evaluation period is in violation of copyright laws.

Distribution of Perl2Exe

You are hereby licensed to make as many copies of the shareware evaluation version of this software and documentation as you wish; give exact copies of the original shareware version to anyone; and distribute the shareware version of the software and documentation
in its unmodified form via electronic means. There is no charge for any of the above.

You are specifically prohibited from charging, or requesting donations, for any such copies, however made; and from distributing the software and/or documentation with other products (commercial or otherwise) without prior written permission, with one exception: Disk Vendors approved by the Association of Shareware Professionals are permitted to redistribute Perl2Exe subject to the conditions in this license, without specific written permission.