Forums Register Login

Is there any way where you can pass values from java to the perl program?

+Pie Number of slices to send: Send
I have a stand alone application which take the inputs from the user. i have a perl program which works fine on its own.
But is there any way where i can take the inputs from that stand alone java application and pass the inputs to this perl program to do some processing?
+Pie Number of slices to send: Send
If you wanted to make a machine-specific call you could use the Runtime.getRuntime().exec("appname " + arglist), in the middle of your program to reference an external application. Hope this helps,
Larry
+Pie Number of slices to send: Send
i am new to perl world, so can u please elaborate on that.
I am using Visual Age for java and Active Perl for windows platform.
+Pie Number of slices to send: Send
Well that's your problem John, you're using VisualAge . Just kidding. Actually, I'm not sure exactly what kind of elaboration I can provide you, except to make sure that you reference your Perl program with the exec() call relative to that path that it is in, and make sure that the arguments that you append to the string match the arguments that you take in from the command-line with your Perl program. Maybe if I knew the kind of problem you were running into (specifically), I could help you better. Did you try the command above? Where is your java program and your perl program located? Let me know what you're running into. Hope I can help,
Larry
+Pie Number of slices to send: Send
I have mentioned the full path :
Runtime R = Runtime.getRuntime();

R.exec("d:\\ActivePerl\\bin\\perl rscdetail2.pl " + contract_number+" "+member_id+" "+start_date+" "+end_date);
I used Visual age Debugger and checked the value it generates from this -- "d:\\ActivePerl\\bin\\perl rscdetail2.pl "+ contract_number+" "+member_id+" "+start_date+" "+end_date
i guess its generating a correct path to look up for rscdetail2.pl but for some reason it's not understanding R.exec() ???
Does it have to do anything with Active perl for windows platform.
Grow your own food... or this tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com


reply
reply
This thread has been viewed 1145 times.
Similar Threads
Is there any way where you can pass values from java to the perl program?
"public static void main(String[] args)" rule?
Invoke Java from Perl
Calling Struts from standalone Java application
How can you pass the arguments from the java program to the perl program?
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 28, 2024 07:54:19.