如何编译我的Perl脚本,以便可以在未安装perl的系统上执行它? [英] How can I compile my Perl script so it can be executed on systems without perl installed?

查看:161
本文介绍了如何编译我的Perl脚本,以便可以在未安装perl的系统上执行它?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个.pl文件,即使没有安装perl,我也想在任何系统中执行该文件.我该如何实现?

I have a .pl file and I want to execute that file in any system even though perl is not installed. How can i achieve it?

有人可以让我知道一些很好的例子吗?

Can any one let me know with some good examples to do that?

推荐答案

pp 可以创建一个包含perl和脚本(以及任何模块依赖项)的可执行文件,但是它是特定于您的体系结构的,因此您不能在Windows和linux上同时运行它.

pp can create an executable that includes perl and your script (and any module dependencies), but it will be specific to your architecture, so you couldn't run it on both Windows and linux for instance.

来自其文档:

要制作独立的可执行文件,使其适合在未安装perl的计算机上运行:

To make a stand-alone executable, suitable for running on a machine that doesn't have perl installed:

   % pp -o packed.exe source.pl        # makes packed.exe
   # Now, deploy 'packed.exe' to target machine...
   $ packed.exe                        # run it

(%和$在不同的计算机上有命令提示符).

(% and $ there are command prompts on different machines).

这篇关于如何编译我的Perl脚本,以便可以在未安装perl的系统上执行它?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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