Slashdot Mirror


PHP and Perl in One Script?

gbulmash asks: "Recently, I began working on a graphics project and wanted to use ImageMagick. As a PHP coder, I figured I'd use MagickWand for PHP. But after some investigation, I decided that an alpha at 0.1.8 with sparse documentation just wasn't going to be good enough for production use. I decided that PerlMagick would be a much better API, but I didn't want to code the whole project in Perl. In the end, I found a cool package for embedding Perl code in PHP scripts (with an article on its use) and it went to a 1.0.0 release, earlier this year. I think I've found my answer, but before I make a final decision and go ahead with it, I thought I'd ask the knowledgeable Slashdot crowd: Is there a better way of interfacing Perl with PHP so you can get the best of both worlds?" So you've got Perl in your PHP, is there a way to do PHP in your Perl?

3 of 174 comments (clear)

  1. Re:If you use PHP.... by 0racle · · Score: 0, Flamebait

    It means you chose to use an inferior language.

    --
    "I use a Mac because I'm just better than you are."
  2. Re:If you use PHP.... by ruckc · · Score: 0, Flamebait

    Sadly i have to admit that i use perl & php together...

    Perl's DBD for Postgresql has some issues dealing with oddly formed strings (even when properly quoted). PHP doesn't have this issue (even when the strings are unquoted). So i literally execute a php script on the CLI to perform insert operations. (The php script just reads a temporary file with the data needed to insert.)

    Yes this is hokey... but it works, and i didn't want to spend another hour or two figuring out why perl was having issues.

  3. Re:It's like peanut butter and chocolate... by quokkapox · · Score: 0, Flamebait

    All the security of PHP and all the readability of Perl? It's a surefire win. I wonder why the whole world hasn't caught on to this one yet?

    Ummm, maybe the legendary robustness and scalability of IIS and ASP?

    --
    it's a blue bright blue Saturday hey hey