http://qs321.pair.com?node_id=661239

kmiles has asked for the wisdom of the Perl Monks concerning the following question:

Hi Monks, I have several new web sites that use PHP heavily (all of our existing sites use Perl). All I want to be able to do is create a PHP template for output from a Perl program. Template is created, slurp the template into $var, replace with content using regexp, then print STDOUT "Content-type: text/html\n\n$var\n"; Problem is that <?php commands ?> are ignored when dumped this way. I've written the contents to a temp file and then output a html redirect, which works but is very messy and slow. Is there a way to output to STDOUT but have the PHP processed? Thanks for any help!