Compile Perl Script Using PAR
PAR allows you to make your Perl scripts portable. It will allow them to bundle with the interpreter, any DLLs, and all modules required to simply pass around your exe.
How to Install PAR
This is tested on Strawberry Perl, Windows 10. YMMV.
Installing PAR will require a few other modules first. Please install the following, in the following order:
- Test::Pod
- Module::ScanDeps
- Getopt::ArgvFile
- PAR::Packer
- PAR
How to Install Modules
1 2 |
C:\>perl -MCPAN -e shell cpan>Install Some::Module |
Compile the Module Manually
If you must manually compile them on your system, you know the method:
- extract to a folder
- move it to C:\strawberry\perl\lib\
1 2 3 4 5 |
cd C:\strawberry\perl\lib\somefolder perl makefile.pl dmake dmake test dmake install |
Create the Compiled Binary:
There are many options such as hiding windows in the documentation. Here is a sample syntax to get you going.
1 |
C:\> pp --gui --icon Icon.ico -o sample.exe sample.pl |
Full PAR documentation here:
http://search.cpan.org/~autrijus/PAR-0.85/script/pp You can also view the documentation by typing the following at a command prompt:
1 |
perldoc pp |