• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

executing perl scripts from java

 
dan nwankwo
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How can i execute a perl script from within my java programme. The script is designed to output a text file. i then want my program to read the file and display stuff. Thanks
 
Valentin Crettaz
Gold Digger
Sheriff
Posts: 7610
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have never tried that but I think you could use the java.lang.Runtime.getRuntime().exec() method and passing the Perl interpreter and the Perl script as argument to that method.
Something like:
Runtime run = Runtime.getRuntime();
Process proc = run.exec("perl myscript.pl");
...
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic