How can we call the perl script file from Pl/sql package

ramadevimandala used Ask the Experts™

I want to run the .pl file from pl/sql procedure and read the return value in the procedure.
and my perl script is present in unix box.
please give sample code.. very urgent.
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Most Valuable Expert 2011
Top Expert 2016

Is this something you're trying to do in PHP?

I followed this when trying it...

Also you could try:

$poc = shell_exec("perl .pl script");
$parms = explode("&",$poc);

or you could use cURL if you can access it thru a URL:

$ch = curl_init();
$timeout = 0; // set to zero for no timeout
curl_setopt ($ch, CURLOPT_URL, '');
curl_setopt ($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt ($ch, CURLOPT_CONNECTTIMEOUT, $timeout);
$file_contents = curl_exec($ch);
echo $file_contents;

sorry in above i was doing something specific:

$poc = shell_exec("perl");

after this $poc should contain the results, so vardump/dump this to see what is returned then you can determine what to do with it.
Ensure you’re charging the right price for your IT

Do you wonder if your IT business is truly profitable or if you should raise your prices? Learn how to calculate your overhead burden using our free interactive tool and use it to determine the right price for your IT services. Start calculating Now!

one thing to note is file permissions they may stop it from working.


No I want to run the perl script file from PL/sql procedure not from PHP
Now I have changed all the logic from perl script and implemented the same with java,as I could nt run the perl script,Thank you all for ur time.

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial