File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
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

executing perl scripts from java

dan nwankwo

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

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");

[Blog] [Blogroll] [My Reviews] My Linked In
I agree. Here's the link:
subject: executing perl scripts from java
Similar Threads
how to invoke perl script on unix server from local machine
Urgent: Calling perl from Java
Communication between Java and Perl
How to call a cgi/perl script from jsp/java bean
To check if there are any open file descriptors on a text file