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

ramadevimandala
ramadevimandala used Ask the Experts™
on
Hi,

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.
Thanks
Comment
Watch Question

Do more with

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

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

Commented:
I followed this when trying it...
http://www.phpqa.in/2009/05/running-perl-script-from-php.html

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:

<?php
$ch = curl_init();
$timeout = 0; // set to zero for no timeout
curl_setopt ($ch, CURLOPT_URL, 'http://www.yourserver.com/cgi-bin/script.pl');
curl_setopt ($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt ($ch, CURLOPT_CONNECTTIMEOUT, $timeout);
$file_contents = curl_exec($ch);
curl_close($ch);
echo $file_contents;
?>

Commented:
sorry in above i was doing something specific:

$poc = shell_exec("perl your.pl");

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!

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

Author

Commented:
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