Home: Perl Programming Help: Advanced:
Calling JAVA API



eroykam
New User

Jun 15, 2017, 11:55 PM


Views: 3411
Calling JAVA API

There are some Java APIs. I need to write a code on calling those Java APIs from a Perl script. One will be for insertion records in the oracle database calling the API and the other API will be to read the return data-set and write in a file.
Can anyone help me in building up the knowledge on how to do this in Perl.


FishMonger
Veteran / Moderator

Jun 16, 2017, 8:21 AM


Views: 3400
Re: [eroykam] Calling JAVA API

Perl has multiple ways to run external programs.

The most common method is to use the system() function.
http://perldoc.perl.org/functions/system.html

Another option is to use the ` ` backticks or qx() operator. You can learn about them in the perlop documentation.
http://perldoc.perl.org/perlop.html

Another option, if you need/want more control, would be to use one of the IPC modules, such as IPC::Run
https://metacpan.org/pod/IPC::Run