Cap'n Steve has asked for the wisdom of the Perl Monks concerning the following question:

I know PHP is kind of a dirty word among the community, but I wanted to do something that involves interaction between PHP and Perl. I recently noticed PHP.pm which might do everything I need. However, it's very new and I can't seem to get it to install or find any information about it. Has anyone else had any success with it?

Replies are listed 'Best First'.
Re: Has anyone tried PHP.pm?
by revdiablo (Prior) on Apr 24, 2005 at 01:38 UTC
    Has anyone else had any success with it?

    I think the lack of response so far may say something about that, though I don't know for sure. I'm curious to know, though, why you need PHP.pm to perform "interaction between some PHP and Perl." Both languages are capable of taking outside arguments and data through various mechanisms. While I don't necessarily endorse this course of action, I don't see why you should need to execute PHP code from Perl to accomplish it.

      I prefer Perl, but most of the leading forum software is written in PHP. I run vBulletin right now and one of the things I like about it is that it's simple to integrate any PHP file with it. You just require global.php and you have easy access to everything that makes up the forum. It would be nice to extend the forum into my Perl scripts without actually changing any PHP files or doing something complicated to share data between the two languages.
Re: Has anyone tried PHP.pm?
by TedPride (Priest) on Apr 24, 2005 at 07:56 UTC
    Hmm. Do you want access to PHP functions or just data values defined in the globals file? The latter can probably be extracted with a little regex work, but the former is going to be difficult - unless you want to set up a mediatior PHP file for each function that can be called from Perl, accept arguments, and pass them to the function.

    Personally, I'd just take a few days and learn PHP. It's not a difficult language. I like using both Perl and PHP myself, but I don't mix the two except when using Perl to generate HTML / PHP from a template.

      I do know a little bit of PHP, which is why I prefer Perl. :p

      It's mostly PHP functions I want access to. While it would be fairly easy to rewrite them in Perl, any new release of the forum software would probably break my module. There's also possible license issues to be considered when copying large chunks of code.
        Whoops. That was me, in case you were wondering.
Re: Has anyone tried PHP.pm?
by jacques (Priest) on Apr 24, 2005 at 04:39 UTC
    I know PHP is kind of a dirty word among the community

    Yes, it is. And that is sad.

      Truth is never sad.

      Well, ok, some times it is. Like, if your mother died, ya know, that would be sad, even if it was the truth. So I suppose the truth can be sad. But in this case, it isn't.