I am calling a perl script from a PHP server side script. In the Perl Script I have a bunch of prints and sleeps. Problem is that the browser waits for the Perl Script to complete to display the prints. The prints are intented to give the user a live status of whats going on. But browser waits till the script exits and then displays everything

I tried adding $|=1; but it did not help

I am using: Perl: This is perl, v5.8.8 built for i386-linux-thread-multi

I don't have a lot of experience with php. Personally, I hate it and only use it when required by my boss.

If you read the user comments on php.net about the passthru() function you'll find postings from others with the same problem. Their recommendation was to use popen() instead of passthru(). I have not tried it myself, but it's worth a shot.