How can I call a PHP script from a Perl script and get its output as a variable?
Using the backtick operator:
my $phpOutput = `/usr/bin/php-cli your-script.php`;
Note that you may have to edit the path to point to your php executable.
If you want to have the output as a stream you can also open with a pipe (Perl <3):
open PHPOUT, "/usr/bin/php-cli your-script.php|";
while () {
# do something with the current line $_
}
See perldoc -f open.