> I'm not entirely sure if I'm getting what you're asking here - I get the
> impression you want the Perl program to call the php script, such as
> http://localhost/script.php3 and get the results from that script which you
> then push into the results of your perl script, correct? The reason I'm
> not sure is the part where you create a bunch of files in your tmp directory
> and then process those. Are you saying you're getting perl to create PHP
> code, and getting Apache to process those, and then returning the results,
> or that you're getting perl to create a batch command essentially?
This is the problem.. I'm not just fetching a local php page, I am actually
using Perl to generate a bunch of PHP commands, which I then want Apache
to process on the way back to the client. Until a stable 2.0 Apache is
out and I can use SetOutputFilter, I am left with (what I think is the only
choice left...) creating a temporary file, under DOCUMENT_ROOT, putting the
generated PHP into it, using LWP or friends to fetch that page throuh Apache,
which will then parse the PHP with mod_php, and send that output back to
the client via 'print $fetched_contents;'
> Either way, the 'simple' way to do this is using LWP, as suggested by
> someone else on the list. Even if it's running on the same server, LWP will
> work just fine. LWP is a perl module that you can get on CPAN to do http
> requests for you. That is, directly in your perl program instead of using
> lynx, you can call to get another web page like so (untested):
Ironically, having tried the suggestion from Darren, I discover that I don't have
LWP installed. My sysadmin however, will install anything for me as long as
I provide him with an RPM for it.
I don't mean to sound lazy, and I have just checked rpmfind.net, but I can't
quickly put my hands on an rpm which includes LWP::Simple for Red Hat 7.0
Assuming I sort this out, I think I will have found a way out, by creating a file
with my PHP in, as described above.
On another note, Apache.org mentions the 'forthcoming' stable release of 2.0.
Does anybody have any idea of how long this will be... From what I read on the
net, and the Apache FAQ, it will be very simple to specify that a certain
directory will be filtered through another module, ie getting perl script output
filtered through PHP by Apache before returning to the client. Perhaps somebody
has experience with the beta release of Apache 2.0 ???
James.