Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
PerlMonks  

Package required to execute perl script

by Anonymous Monk
on Oct 20, 2010 at 08:24 UTC ( [id://866263]=perlquestion: print w/replies, xml ) Need Help??

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

    This is a Java question, not a Perl question. I would ask whoever gave you the code about what packages you need. In Java, you usually have import statements that import packages from com.wherever.something.

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
    Hi,

    Will this help ?

    if not... :)

Re: Package required to execute perl scripts in java
by jettero (Monsignor) on Oct 20, 2010 at 10:15 UTC
    It's not at all clear to me what this you expected to happen and what didn't happen. This also seems more of a question for the programmers who imported Perl into Java to me. That is, unless you're seeing some Perl error you forgot to mention.programmers
Re: Package required to execute perl script
by DrHyde (Prior) on Oct 20, 2010 at 10:15 UTC
    Oops, sorry, I Considered the wrong node

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://866263]
Approved by Corion
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (3)
As of 2024-04-25 05:35 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found