What is the best strategy to deploy a Perl 6 script which use external modules like LWP::Simple
?
For example in Perl we have PAR
. Is there are an option in Perl 6 to deploy a self contained script that the user need only to run without bothering himself with installing Rakudo and external Perl 6 modules?
You can create a .jar file and then use java to execute the code. From there, there are plenty of tools to convert a .jar into a binary file (or .exe in Windows).
The syntax for that is:
perl6 --target=jvm --output=your_file.jar your_file.pl6
If that script were the trivial
say "this is running as a .jar file"
You should be able to run java -jar your_file.jar
and get
this is running as a .jar file
On macOS, there is a bit of a wrinkle since this feature requires you to build perl6 (Rakudo Star) with Java 1.7+ instead of the Mac's system Java. For this reason the version on your system may not have shipped with JVM support.
If you're using homebrew
, here's what you do to fix that:
brew uninstall perl6
brew tap homebrew/versions
(so you can install Java 1.7)brew install Caskroom/versions/java7
(install Java 1.7)brew install perl6 --with-jvm
(build perl6
with Java Virtual Machine support)If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With