Connecting Tech Pros Worldwide Forums | Help | Site Map

Return a value from perl script to php program

Newbie
 
Join Date: Apr 2007
Posts: 1
#1: Apr 12 '07
hi,
can anyone help me how to return a value from perl script (not all of them) to php program, please?

Thanks

for example:

-------------
p1.pl
-----------
print "this is a test\n";
$i = 10;
print STDOUT "PERL $i\n";

------------------------
p2.php
------------------
<?php
ob_start();

passthru ("perl t_perl.pl");
$result = ob_get_clean();
print $result;

?>

I have the following result when using "php p2.php"

this is a test
PERL 10

----- The problem
I don't want "this is a test" returns. Want ONLY "PERL 10" returning. Any help is appreciated. Thanks

Reply