Help coderanch get a
new server
by contributing to the fundraiser
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Devaka Cooray
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • paul wheaton
  • Henry Wong
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Tim Moores
  • Carey Brown
  • Mikalai Zaikin
Bartenders:
  • Lou Hamers
  • Piet Souris
  • Frits Walraven

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

 
Greenhorn
Posts: 23
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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?
 
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
john klucas
Greenhorn
Posts: 23
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Larry Anderson
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
john klucas
Greenhorn
Posts: 23
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
reply
    Bookmark Topic Watch Topic
  • New Topic