Information Technology Grimoire

Version .0.0.1

IT Notes from various projects because I forget, and hopefully they help you too.

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

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\

    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.

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:

perldoc pp
Last updated on 30 Jul 2019
Published on 30 Jul 2019