Perl – Compile source naar binary (makefile)

makefile icon

perl logo

Dit voorbeeld laat zien hoe je een PERL script omzet in een EXE bestand voor Windows met Perl en PAR-packer.

Wat heb je nodig?

1) Perl voor windows

Informatie (ENG)

This module implements the App::Packer::Backend interface, for generating stand-alone executables, perl scripts and PAR files.

Currently, this module is used by the command line tool pp internally, as well as by the contributed contrib/gui_pp/gpp program.

Since version 0.97 of PAR, this module and its related tools such as pp have been stripped from the PAR distribution and are now distributed as the PAR-Packer distribution so that PAR users need not necessarily have a C compiler.

Aan de slag

Hieronder is een voorbeeld van het programma Markdown met PAR-Packer v1.0.03 met PERL v5.16.2

1) Installeer Perl v5.16.2 (C:\Perl)
2) Pak het GZ archief uit in de map C:\Perl
3) Ga naar de folder en geef het commando: perl makefile.pl

Nu zie je ook wat je verder nodig hebt.

4) Installeer de aanvulende benodigde modules met de commandos:

Output:

5) Installeer MingW met het commando: ppm install MingW

6) Installeer PAR Packer met de volgende commando’s: dmake , dan dmake test , dan dmake install

7) Compileer markdown (perl bestand: markdown.pl)

8) Gebruik nu pp om het Perl script te converteren naar een executable (exe) voor Windows, met het volgende commando

pp markdown.pl

Er is nu een bestand a.exe aangemaakt (hernoemen naar markdown.exe), gefeliciteerd, je hebt nu een executable bestand voor windows gemaakt van een Perl script.

Bron:
stackoverflow.com


Download PAR-packer @ search.cpan.org