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

查看:77
本文介绍了如何编译我的 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?

有什么好的例子可以做到这一点?

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