-
Notifications
You must be signed in to change notification settings - Fork 3
Open
Description
Need an example of compilation and separate execution.
public static void main(String[] args) {
// exiftool -ver
String newargs[] = new String[]{
"/C/F/Projects/PerlOnJava/Image-ExifTool-13.50/exiftool",
"-ver"};
CompilerOptions parsedArgs = ArgumentParser.parseArguments(newargs);
if (parsedArgs.code == null) {
System.err.println("No code provided. Use -e <code> or specify a filename.");
System.exit(1);
}
try {
Object executable = PerlLanguageProvider.compilePerlCode(parsedArgs);
// How to execute? What is that returned object?
The compilePerlCode comments say "The compiled code instance (can be used with RuntimeCode.apply via MethodHandle)" but it is not clear how to do this. There are references to executing compiled code in perlonjava-web.md and java-integration.md but these may not be up to date.
This is a good time to ask if what I want to do will ever work. What I want to do is compile ExifTool once and then execute it many times with different arguments. The speed and size characteristics must be comparable to standard Perl.
Thanks.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels