File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Beginning Java and the fly likes executing perl scripts from java Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "executing perl scripts from java" Watch "executing perl scripts from java" New topic
Author

executing perl scripts from java

dan nwankwo
Greenhorn

Joined: May 23, 2001
Posts: 8
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

Joined: Aug 26, 2001
Posts: 7610
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");
...


SCJP 5, SCJD, SCBCD, SCWCD, SCDJWS, IBM XML
[Blog] [Blogroll] [My Reviews] My Linked In
 
jQuery in Action, 2nd edition
 
subject: executing perl scripts from java