Click to See Complete Forum and Search --> : passing vars from Perl to PHP


CurrentWave
06-03-2003, 04:07 PM
I posted this under general for the Perl, but maybe I should post it here too.

I need to gab some variables from a Perl 5 file before they are gone.

First, I need to know how to call a php file from a Perl file, and second, how to pass the vars from the Perl file to the second file (PHP) for use.
I need to keep it simple :-)

Thanks!

jeffmott
06-03-2003, 04:34 PM
You could start with looking at PHP::Include (http://search.cpan.org/author/ESUMMERS/PHP-Include-0.05/lib/PHP/Include.pm). Though the documentation says it is form simple PHP files so I might not put too much faith in it.

Since PHP is a part of the document that is parsed by the server before being returned, and a Perl file functions more as an independant application, it would probably be easier to include output from a Perl program into PHP rather than the other way around. The system function would allow you to execute a Perl program and store the return value, almost as if the entire Perl script was a subroutine for your PHP file to call.

But all of this is fairly speculative. In fact the easiest solution may be to write your entire program in one language.

CurrentWave
06-03-2003, 05:42 PM
I agree that staying with one or the other would be best, but the Perl file belongs to a third party and is use by their secure server for transaction processing. So over that I have no control.

What I want to do is to
(1) send autoresponses
(2) write the vars data to a file with an unique name.

I know how to do this in PHP, and have tried to do it in Perl, but its bombing on me.

So I thought if I could just pass the vars from Perl into a more managable PHP file - easy street, but you know it never works out that way.

Thanks for your reply!