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

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

问题描述

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



有几个解决方案,我知道: / p>


  1. perl2exe < a> of IndigoStar
    这是商业。我从来没有试过。它的网站说它可以交叉编译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进行打包。

其他推荐的解决方案?

解决方案

除了问题中列出的三个工具之外,还有另一个名为 Cava Packager 由Mark Dootson写,他也贡献了 PAR 。它只运行在Windows下,有一个不错的Wx GUI和工作不同于典型的三个竞争者,它组装所有的Perl依赖在一个源/ lib目录,而不是创建一个包含一切的归档。有一个免费版本,但它不是开源。除了测试,我没有用过。



对于PAR,它真的是一个工具包。它附带一个包装工具,它执行独立可执行文件的依赖性扫描和组装,但它也可以用于生成和使用所谓的.par文件,类似于Java的JAR。它还附带了客户端服务器,用于通过网络自动加载缺少的包等。 YAPC :: EU 上发表演讲/讲座/ appdeployment /rel =nofollow noreferrer>我的PAR谈话幻灯片 > 2008有关这方面的更多细节。
还有一个活动邮件列表:par at perl dot org。


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:

  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.

Other recommended solutions?

解决方案

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.

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天全站免登陆