I am running perl script through Java. The code is as shown below.
try {
Process p = Runtime.getRuntime().exec("perl 2.pl");
BufferedReader br = new BufferedReader(
new InputStreamReader(p.getInputStream()));
System.out.println(br.readLine());
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
My perl script is in such way that when I run it directly through command line it ask me to supply input file. My question is how could I supply file name to perl script through Java?