What's the most cross-platform way to execute a Perl script from Ant?

What's the most cross-platform way to execute a pPerl script from ant?

Windows doesn't like Perl script as executable. Is there any way other than just running Perl using the OS executable and passing the Perl script as an argument?

+2


source to share


3 answers


Have you reviewed the ant command <exec>

? You can use the attribute os

to indicate which operating system to use.



The pitfall will be that you need a specific call for every known operating system that the Perl script will be used on. It is probably safer to do os.

+2


source


Whether you create a custom Ant goal tried to call the Perl (call it call-perl-script

), and the implementation of this task will switch to the other sub-task OS-based (eg call-perl-script-windows

, call-perl-script-osx

etc.) ..)?



Something based on this previous question or this or this ?

+1


source


Windows doesn't like Perl script as executable.

Or you customize windows to execute .pl files (help ftype, help assoc)

ftype PerlScript=perl.exe %1 %*
assoc .pl=PerlScript

      

or you run the script via pl2bat (happens automatically if you use ExtUtils :: MakeMaker to install the script). If you are using pl2bat, review the resulting file and make sure you are satisfied with the results.

you can also use PAR / pp to create the .exe

0


source







All Articles