如何打包我的 Perl 脚本以在没有 Perl 的机器上运行? [英] How can I package my Perl script to run on a machine without Perl?

查看:25
本文介绍了如何打包我的 Perl 脚本以在没有 Perl 的机器上运行?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

人们也经常问我如何编译 Perl?"而他们真正想要的是创建一个可执行文件,即使他们没有安装 Perl,也可以在机器上运行.

People also often ask "How can I compile Perl?" while what they really want is to create an executable that can run on machines even if they don't have Perl installed.

我知道有几种解决方案:

There are several solutions, I know of:

    IndigoStar 的
  1. perl2exe它是商业的.我从来没有尝试过.它的网站说它可以交叉编译 Win32、Linux 和 Solaris.
  2. Perl Dev Kit 来自 ActiveState.它是商业的.几年前我在 Windows 上使用过它,它很好地满足了我的需求.根据其网站,它适用于 Windows、Mac OS X、Linux、Solaris、AIX 和 HP-UX.
  3. PAR 或更确切地说 PAR::Packer 是免费和开源的.根据测试报告,它适用于 Windows、Mac OS X、Linux、NetBSD 和 Solaris,但理论上它也适用于其他 UNIX 系统.最近我开始在 Linux 上使用 PAR 进行打包,并将在 Windows 上使用它.
  1. perl2exe of IndigoStar It is commercial. I never tried. Its web site says it can cross compile Win32, Linux, and Solaris.
  2. Perl Dev Kit from ActiveState. It is commercial. I used it several years ago on Windows and it worked well for my needs. According to its web site it works on Windows, Mac OS X, Linux, Solaris, AIX and HP-UX.
  3. PAR or rather PAR::Packer that is free and open source. Based on the test reports it works on the Windows, Mac OS X, Linux, NetBSD and Solaris but theoretically it should work on other UNIX systems as well. Recently I have started to use PAR for packaging on Linux and will use it on Windows as well.

其他推荐的解决方案?

推荐答案

除了问题中列出的三个工具之外,还有一个叫做 Cava Packager 由 Mark Dootson 编写,他还为 PAR 做出了贡献过去的.它只在 Windows 下运行,有一个很好的 Wx GUI,并且与典型的三个竞争者不同,它的工作方式与典型的三个竞争者不同,因为它将所有 Perl 依赖项组装在一个 source/lib 目录中,而不是创建一个包含所有内容的单个存档.有一个免费版本,但它不是开源的.除了测试,我没有使用过这个.

In addition to the three tools listed in the question, there's another one called Cava Packager written by Mark Dootson, who has also contributed to PAR in the past. It only runs under Windows, has a nice Wx GUI and works differently from the typical three contenders in that it assembles all Perl dependencies in a source / lib directory instead of creating a single archive containing everything. There's a free version, but it's not Open Source. I haven't used this except for testing.

至于 PAR,它确实是一个工具包.它带有一个打包工具,可以对独立的可执行文件进行依赖扫描和组装,但它也可以用来生成和使用所谓的 .par 文件,类似于 Java 的 JAR.它还带有 clientserver 用于通过网络自动加载丢失的包等.我的 PAR 演讲幻灯片YAPC::EU 2008 年对此进行了更详细的介绍.还有一个活跃的邮件列表:par at perl dot org.

As for PAR, it's really a toolkit. It comes with a packaging tool which does the dependency scanning and assembly of stand-alone executables, but it can also be used to generate and use so-called .par files, in analogy to Java's JARs. It also comes with client and server for automatically loading missing packages over the network, etc. The slides of my PAR talk at YAPC::EU 2008 go into more details on this. There's also an active mailing list: par at perl dot org.

这篇关于如何打包我的 Perl 脚本以在没有 Perl 的机器上运行?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆