I’m still learning Perl at the moment and have been trying to get a Perl script working.
This is a simple script that executes a Java JAR file with a text file as an input parameter as its configuration file.
For example if I were to execute the jar normally in the commandline:
java -jar myfile.jar sometextfile.txt
I want to do this in Perl. So far, I have:
open(INPUT, "<$ARGV[0]");
my @args = ("java", "-jar", "nyfile.jar", INPUT);
system(@args);
close(INPUT);
The script doesn’t seem to pass the input file when it is executed. What am I doing wrong?
Thanks in advance for any help I can get.
Don’t open the file in Perl, just pass the file name (as an argument) to Java: