How to generate exe for your PERL script?

The way I am using is PAR Packer.

1.      Downloadmodule PAR Packer:

http://search.cpan.org/~rschupp/PAR-Packer-1.024/lib/PAR/Packer.pm

2.      InstallPAR Packer:

2.1 Unzipthe *.tar

2.2 Go tothe directory and run “perl Makefile,pl”, if you are using active perl, you mayget some error about you don’t have GCC compiler, you need to install migGW asmentioned in step3

3.      Downloadand Install MinGW: from website:
http://www.mingw.org/

The version I used is: http://tdm-gcc.tdragon.net/download

3.1 Payattention if you already add the value path ” C:\MinGW\64\bin” in your systemVariables

3.2 Run gcc –v to see if it issuccessfully installed:

C:\Rebecca\script\perl>gcc -v

Using built-in specs.

COLLECT_GCC=gcc

COLLECT_LTO_WRAPPER=C:/MinGW/64/bin/../libexec/gcc/x86_64-w64-mingw32/4.9.2/

Target: x86_64-w64-mingw32

Configured with: ../../../src/gcc-4.9.2/configure--build=x86_64-w64-mingw32

Thread model: posix

gcc version 4.9.2 (tdm64-1)

4.      Run perl Makefile.pl, you may get the followingerrors:

C:\Users\rebecca\Desktop\PAR-Packer-1.024>perlMakefile.pl

It looks like you don‘t have either nmake.exe ordmake.exe on your PATH,

so you will not be able to execute the commands froma Makefile.  You can

install dmake.exe with the Perl Package Manager byrunning:

ppm install dmake

you need to install dmake assuggested, you can run “ppm install dmake”, but you may get the followingerrors:

C:\Rebecca\script\perl>ppm install dmake

Downloading ActiveState Package Repositorypacklist...redirect

Downloading ActiveState Package Repository packlist...failed401 Unauthorized

Syncing site PPM database with .packlists...done

Syncing perl PPM database with .packlists...done

Downloading dmake-4.11.20080107...redirect

Downloading dmake-4.11.20080107...failed 401 Unauthorized

ppm install failed: 401 Unauthorized

Itis because the Active Perl you are using now is not business version, itdoesn’t support to install automatically online. You need to install itmanually by following step5

5.      Installdmake: http://search.cpan.org/dist/dmake/

According to the instruction in README.TXT:

So, to install it, just copy dmake.exe and the startupsubdirectory to some location on your path.

6.      Checkif you already have dmake successfully installed:

C:\Rebecca\script\perl>dmake -V

dmake - Version 4.12.2.2 (Windows / MS Visual C++)

Copyright (c) 1990,...,1997 by WTI Corp.

Default Configuration:

MAXLINELENGTH := 32766

MAXPROCESSLIMIT := 64

.IMPORT.IGNORE: DMAKEROOT

.MAKEFILES :makefile.mk makefile

.SOURCE    : .NULL

DMAKEROOT *=$(ABSMAKECMD:d)startup

MAKESTARTUP :=$(DMAKEROOT)\startup.mk

Please read the NEWS file for the latest release notes.

7.      Go toPAR Packer directory:

perl Makefile.pl

dmake

dmake install

8.      Generatethe exe:

C:\Rebecca\script\perl>pp -o hello.exe hello.pl

9.      Done

时间: 2024-08-26 22:50:58

How to generate exe for your PERL script?的相关文章

my perl script --- Trave Target directory and modify files with regex

脚本用于遍历目录下文件,并用正则表达式匹配替换目标string. #!/usr/bin/perl -w use strict; # Trave Target directory and modify files under it. # Modified files are matched using regex. # # V1.1 use Getopt::Long; my $usage = q{ Usage: fix_fetch_found [options] [dir] Output is w

把perl脚本编译成exe

来源:http://www.veryhuo.com/a/view/38338.html 今天想把 perl 脚本编译成 exe 以便脱离 perl 解释器独立运行.都可以生成PERL的PE文件,在PERL官网有介绍. perl脚本编译成exe 一般有4种方法: 1. 使用 perl2exe 工具(需要购买,当然也有破解版或绿色版,不过网上只找到5.0版本的,而我的是5.12版本,版本太低所以不能使用) exe文件体积大 运行慢 2. 使用 ActiveState 公司的 Perl Dev Kit

[转载]两个半小时学会Perl

Learn Perl in about 2 hours 30 minutes By Sam Hughes Perl is a dynamic, dynamically-typed, high-level, scripting (interpreted) language most comparable with PHP and Python. Perl's syntax owes a lot to ancient shell scripting tools, and it is famed fo

玩转 Perl ABC

Perl includes a rich documentation system called Perdoc, as part of the language package. Perldoc is also available on the web at perldoc.perl.org, and in fact this is probably much more convenient for most people. 下载ActivePerlhttps://www.activestate

Perl 关于在程序运行过程中重新开启标准输入的问题

遇见问题是,如何程序运行的时候已经将标准输入使用"<"符号或者"|"符合在命令行定向为一个文件. 可是在程序的运行过程中希望从键盘得到输入内容. 因为/dev/tty为当前进程的控制台,STDIN 为当前的标准输入. 如果重定向,例如: perl script.pl <myfile.txt STDIN 被指向 myfile.txt, 但是 /dev/tty 仍然来自于控制终端.所有的Unix都是这样,不单单是指这个perl. 那么解决方案: #!/usr

博客园博客自动生成三级目录(generate three levels content using JS in cnblogs)

博客园博客自动生成三级目录(generate three levels content using JS in cnblogs) JS代码(JS code) 最近参考了(http://www.cnblogs.com/wangqiguo/p/4355032.html)自动生成目录的方法,我增加了能够自动生成三级目录的JS代码. I learned from (http://www.cnblogs.com/wangqiguo/p/4355032.html) about generating cont

在vi中使用perltidy格式化perl代码

格式优美的perl代码不但让人赏心悦目,并且能够方便阅读. perltidy的是sourceforge的一个小项目,在我们写完乱七八糟的代码后,他能像变魔术一样把代码整理得漂美丽亮,快来体验一下吧!!! perltidy 主页: http://perltidy.sourceforge.net/perltidy.html 安装方法: 进入解压后的文件夹,然后运行一下命令 perl Makefile.PL make make test make install 用法: 配置一下vim,使得我们在写代

Script Control 组件Win7 X64平台运行问题及示例

本文要点: MSSCRIPT.OCX组件只有x86版本,所以要在x64系统下运行,请使用云盘中的x86版本WScript安装程序. 将以下示例代码存为js文件,将其拖动到x86版本的WScript.exe或CScript.exe程序上即可以运行. 示例 Microsoft Script Control 1.0 的Error和Timeout两个事件的使用. 示例 Microsoft Script Control 1.0 的Run方法,Modules模块集合的使用等等. 另外 Microsoft S

perl登录各种网站的原理与实现

tkorays([email protected]) 小孩子才践行大道理,大人只会讲. 写脚本抓取某个页面内容很简单,但是往往事情没那么简单.有些页面必须是要登录才能查看的,比如你想抓取选课系统中自己的成绩?所以,下面介绍下使用perl登录网站的原理,以及实现. 原理 如果你了解一些http原理的话,这就很好理解了.使用浏览器打开网页无非就是:你发送请求,然后服务器响应,给你所需要的页面内容.当然这些请求和相应都是有一定规律的. 先说浏览器发送请求. 请求常用有POST和GET两种,撇去细节不谈