Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
941 views
in Technique[技术] by (71.8m points)

perl - How to install pp (PAR Packager)?

I have to create an exe from a Perl script. I installed

ActivePerl-5.14.2.1402-MSWin32-x86-295342.msi

How do I install pp?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

I know this is a relatively old question, but for the sake of others, here is a solution that worked for me using pp (Par Packager):

  1. Install Strawberry Perl for windows (I installed strawberry-perl-5.16.3.1-64bit.msi)
    • I used 5.16.3.1 because I wanted to try out perl2exe as well, while I'm at it (perl2exe at the time supported only up to 5.16.3 version of perl)
  2. Once installed, open Strawberry Perl Tools (e.g. through start menu -> All programs -> Strawberry Perl -> Tools), and invoke CPAN Client
  3. In the client console that opens, type:
    • get pp
    • install pp
  4. Once installation is complete, you can simply run:
    • c:strawberryperlsiteinpp.bat -o myScript.exe myScript.pl
    • Which will produce a myScript.exe which is a standalone executable (no external perl interpreter is needed)

Note: You can use the -d command line switch in order to reduce the size of the executable. This will not include perl interpreter code inside the executable, reducing the size of the executable, however you will need to provide perl5x.dll in the same directory as your executable, or include it on the PATH environment variable.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...