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

前端 未结 9 457
挽巷
挽巷 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:26

    Look at PAR (Perl Archiving Toolkit).

    PAR is a Cross-Platform Packaging and Deployment tool, dubbed as a cross between Java's JAR and Perl2EXE/PerlApp.

    0 讨论(0)
  • 2020-11-29 18:26

    And let's not forget ActiveState's PDK. It will allow you to compile UI, command line, Windows services and installers.

    I highly recommend it, it has served me very well over the years, but it is around 300$ for a licence.

    0 讨论(0)
  • 2020-11-29 18:28

    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.

    From its doc:

    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).

    0 讨论(0)
提交回复
热议问题