• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How can you pass the arguments from the java program to the perl program?

 
john klucas
Greenhorn
Posts: 23
  • Mark post as helpful
  • send pies
  • 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?
 
Vlad Patryshev
Ranch Hand
Posts: 61
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It is not clear whether you want to do something like
java <yourjavaprogram> | perl <yourperlprogram>
or call a perl program from java, passing stuff to the perl program when it requests input and getting what the program sends as an output (which is feasible too).
 
Sean MacLean
author
Ranch Hand
Posts: 621
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
To do this from an application, you can just do this.
Process p = Runtime.getRuntime().exec("call perl programm here using normal command line...");
Sean
 
john klucas
Greenhorn
Posts: 23
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi sean,
Can u please elaborate on this. I am novice to perl so can u please explain about what u said..? how do u call a perl program from command line..
i am running that perl program on WIN32 platform. I am using Active perl for win32.
I want to take input from the front end(java application)and pass those values to the perl program to do some processing.

Thanks in advance!
 
john klucas
Greenhorn
Posts: 23
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi sean,
Can u please elaborate on this. I am novice to perl so can u please explain about what u said..? how do u call a perl program from command line..
i am running that perl program on WIN32 platform. I am using Active perl for win32.
I want to take input from the front end(java application)and pass those values to the perl program to do some processing.

Thanks in advance!
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic