tags:

views:

87

answers:

1

Hi,

How do I use java to execute a perl script. Thanks a bunch :)

+8  A: 

Without knowing any more of the requirements:

Runtime.getRuntime().exec("/path/to/perl /path/to/perl/script");

Documentation about Runtime.exec: http://download.oracle.com/javase/6/docs/api/java/lang/Runtime.html#exec(java.lang.String)

birryree
Thanks this is exactly what I need :).
Scicare
Adding to answer -- You may want to use newer api -- ProcessBuilder. Passing arguments, processing out/err streams etc are better in this API
Jayan