Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

Re: Perl and PHP

by TJPride (Pilgrim)
on Dec 11, 2012 at 11:21 UTC ( [id://1008269]=note: print w/replies, xml ) Need Help??


in reply to Perl and PHP

Mixing the two is not probably something you should do. Yes, PHP is weak when it comes to manipulating nested data structures, however the difficulty and general messiness of adding Perl to your PHP makes that approach rather abortive. I'd personally either keep the two separate and use an AJAX (Javascript) pull from your Perl script to populate data on your PHP page, or do the page entirely in Perl. Or depending on your needs, you could substitute a properly-designed MySQL query for data manipulation in either language. What precisely are you trying to do?

I use both Perl and PHP for work, incidently - Perl for complicated data processing and PHP for more presentation-oriented sites. I try not to mix the two much in the same site, though.

Replies are listed 'Best First'.
Re^2: Perl and PHP
by Anonymous Monk on Dec 11, 2012 at 14:34 UTC
    PHP's advantage is its disadvantage: it's a great big wad. Everybody's got the same wad. You can't add anything to it with modules; everything is compiled-in. But everyone's got the same wad ... oops! ... until a new PHP version comes along and changes the language. And heaven help you if you add a single unwanted space before or after the bracket tags. Bleah.

      Actually there's plenty of modules for PHP; many of them are distributed as part of the PHP core. For example, the cURL extension. Compile PHP with the --with-curl option and you get cURL; otherwise you don't.

      The difference is that PHP extensions tend to vomit their entire API into the global namespace.

      The embedded Perl interpreter for PHP I mentioned earlier is a compiled PHP extension module. It happens to be one that is not bundled with PHP itself, and also a rare example of an object-oriented one, which manages to avoid polluting the global namespace much.

      perl -E'sub Monkey::do{say$_,for@_,do{($monkey=[caller(0)]->[3])=~s{::}{ }and$monkey}}"Monkey say"->Monkey::do'

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1008269]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others perusing the Monastery: (3)
As of 2024-04-25 17:54 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found