wood burning stoves 2.0*
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

Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
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 myscript.pl");

[Blog] [Blogroll] [My Reviews] My Linked In
I agree. Here's the link: http://aspose.com/file-tools
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
To check if there are any open file descriptors on a text file
How to call a cgi/perl script from jsp/java bean