Background.
I'm using passthru() too execute a perl script.
PHP Script:
// I can choose either this :
passthru("/test.pl var1");
// Or this:
ob_start();
passthru("/test.pl var1");
$myVar = ob_get_contents();
ob_end_clean ();
echo $myVar;
Perl Script:
#!/usr/local/bin/perl
print "Content-type: text/html\n\n";
print 'hello world from outside the cgi-bin';
$ARGV[0] = $ARGV[0].' has been to perl land';
print '<br>'.$ARGV[0];
It works, but instead of printing the expected, it will print
Content-type: text/html hello world from outside the cgi-bin
var1 has been to perl land
Note how "Content-type: text/html" appeared (what doesn't happens if I execute the Perl script directly.
How can I fix this?
Thanks in advance