Well, if PHP is a standalone executable (i.e. the CGI version),
then you could probably call it like any other system command in perl and
catch the output that way (e.g:
open (IN, "/path/to/binary arguments |") or die ("$!\n");
while (<IN>) {
chomp $_;
# $_ containes each line of ouput in order, with no
# newline becuase of the chomp.
}
or
@output = `/path/to/binary arguments`;
foreach $line (@output) {
as above
}
), see section 16.1 in the Perl Cookbook, chapter 8 in programming perl
(2nd).
If PHP is a module in the web server (e.g. a DSO in apache, dll in
IIS, et al.), then what you can do is ask the webserver via the perl
script for the url of the script with appropriate args (i.e. a GET) to
produce what output you want. This is not elegant but it shoudl
work. One way to do this is using one of the modules in the LWP family
(the ORA book by Clinton Wong on programming web clients in perl was
recently released on the net as a free book IIRC). Another is to use
Net::Telnet to directly poke the webserver (basically the same effect as
the first way). A third is to use the open-system-cmd-for-output from the
PHP-as_CGI section above with a call to a command line text-mode browser,
given the URL and a dump-parsed-html-to-stdout switch as args. Lynx and
w3m both support the dump-parsed-html type switch.
What you do with the data in either approach once you get it into
your perl script is up to you. :-)
Mike
*****************Michael Orion Jackson******************
***********TAMS Class of 96/UT Class of 200?************
*********************Random Quote:**********************
****PERL: Pathologically Eclectic Rubbish Lister :-)***
********************************************************
---------------------------------------------------------------------------
Send administrative requests to [EMAIL PROTECTED]