Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
Hi all, I've serious doubt in executing perl scripts in java. I got to know, that using scalar refernce in Java, the array can be passed to perl. After this, i want to execute the perl in java using Getruntime.exec() command
My question is using JDK, i'm not able to execute this java code. What package i need to import in java, to run scalar refernce & running the perl after that
I'm pasting a sample code, of what i need to do. Please help me out in this
To pass the array to perl using scalar referencing public class arrayforPerl { perl void max( int[] data ) {{ # Get the array elements # my @arrPerl = GetIntArrayElements( $data ); }} ## double braces are for the perl code void maxProg() { int[] data = {101, 99, 42, 666, 23}; max( data ); } public static void main(String[] argv) { arrayforPerl javaPerl = new arrayforPerl(); javaPerl.maxProg(); } }
Executing Perl Script Runtime.getRuntime().exec();
Sorry if i'm not clear, i can explain you again
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Package required to execute perl script
by Corion (Patriarch) on Oct 20, 2010 at 08:52 UTC | |
Re: Package required to execute perl script
by angiehope (Pilgrim) on Oct 20, 2010 at 11:55 UTC | |
Re: Package required to execute perl script
by viveksnv (Sexton) on Oct 20, 2010 at 10:26 UTC | |
Re: Package required to execute perl scripts in java
by jettero (Monsignor) on Oct 20, 2010 at 10:15 UTC | |
Re: Package required to execute perl script
by DrHyde (Prior) on Oct 20, 2010 at 10:15 UTC |