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