This week's book giveaway is in the Design forum.
We're giving away four copies of Building Microservices and have Sam Newman on-line!
See this thread for details.
The moose likes Java in General and the fly likes Communication between Java and Perl Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Building Microservices this week in the Design forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "Communication between Java and Perl" Watch "Communication between Java and Perl" New topic

Communication between Java and Perl

Abhijeet Sinha

Joined: Sep 15, 2011
Posts: 10
Hi All,

I want to call a perl scripts from my java application. this perl script will receive parameters and after execution returns to the application
Can you tell me how to call this perl script from java. What are the exceptions i have to take care of when calling and returning from the script
Is it possible to call another script from the perl script and keeptrack of exceptions that may arrise in inter calling.

Thanks in advance
Akhilesh Trivedi
Ranch Hand

Joined: Jun 22, 2005
Posts: 1598
Can we call java program from perl script?

Keep Smiling Always — My life is smoother when running silent. -paul
[FAQs] [Certification Guides] [The Linux Documentation Project]
Tim Moores

Joined: Sep 21, 2011
Posts: 2409
The java.lang.ProcessBuilder class comes to mind, and, of course, Runtime.exec.
Abhijeet Sinha

Joined: Sep 15, 2011
Posts: 10
How to pass arguments from a java code to native script?
I want to pass an array form my java code to a perl to pass and how to receive it there in perl script
any idea..?

thanks in advance
Matthew Brown

Joined: Apr 06, 2010
Posts: 4541

Small array, or big array? For a small array you could add them to the perl command line you're calling. For a bit array, the simplest approach I can think of is to save it to a temporary file, and pass the filename to the perl script.
Abhijeet Sinha

Joined: Sep 15, 2011
Posts: 10
it will be an array of three strings,but the length of string is large.
Abhijeet Sinha

Joined: Sep 15, 2011
Posts: 10
can any one give me some simple examples how to do that..
Have you checked out Aspose?
subject: Communication between Java and Perl
It's not a secret anymore!