Mixing PHP and Perl

Posted By: TracyJ ()
Posted On: 2004-Apr-19 22:30

Probably a silly question, but can you put PHP code in a Perl script? I'm doing a major site move and using most PHP, but in order to get the site ready by my deadline, I don't think I'll have time to re-write one particularly complex script, so I'm wondering if I can temporarily just embed some PHP code into a Perl script instead.

Thanks!

Tracy


Posted By: NEntropy ()
Posted On: 2004-Apr-20 06:21

Running PHP and Perl concurrently? I don't think that's possible. You can run external programs in PHP, so one possible way is to write the perl script as a standalone program and run the program within PHP... But this is valid only for certain functions.




Posted By: TracyJ ()
Posted On: 2004-Apr-20 15:34

That's an idea. I'll have to look into that. Though... the more I think about trying to make some PHP stuff work within the parameters of my CGI script, the more I think it's just as fast to re-write the whole thing in PHP. Hmm. We'll see, I guess! smile


Posted By: jcokos (Staff)
Posted On: 2004-Apr-21 03:55

It is possible, using one of a number of Modules from CPAN.

http://search.cpan.org/search?query=php&mode=all

I recall reading somewhere (can't remember) that there's a plugin for PHP that can work the other way around, too.