How can I compile my Perl script so it can be executed on systems without perl installed?

前端 未结 9 481
挽巷
挽巷 2020-11-29 17:39

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

9条回答
  •  遥遥无期
    2020-11-29 18:18

    1. Install PAR::Packer. Example for *nix:

      sudo cpan -i PAR::Packer

      For Strawberry Perl for Windows or for ActivePerl and MSVC installed:

      cpan -i PAR::Packer
    2. Pack it with pp. It will create an executable named "example" or "example.exe" on Windows.

      pp -o example example.pl

    This would work only on the OS where it was built.

    P.S. It is really hard to find a Unix clone without Perl. Did you mean Windows?

提交回复
热议问题