Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
PerlMonks  

Re: Perl and PHP

by CountZero (Bishop)
on Dec 10, 2012 at 20:07 UTC ( #1008160=note: print w/ replies, xml ) Need Help??


in reply to Perl and PHP

PHP is actually at heart only some kind of templating system where you can include PHP-code into your HTML code.

If you like that concept, why not use a Perl-templating system in your web-server?

Template Toolkit can even run pure Perl-code in the web-page.

CountZero

A program should be light and agile, its subroutines connected like a string of pearls. The spirit and intent of the program should be retained throughout. There should be neither too little or too much, neither needless loops nor useless variables, neither lack of structure nor overwhelming rigidity." - The Tao of Programming, 4.1 - Geoffrey James

My blog: Imperial Deltronics


Comment on Re: Perl and PHP
Re^2: Perl and PHP
by vihnny (Initiate) on Dec 10, 2012 at 20:15 UTC
    Thanks, I will for sure look into it. However, I will be able to actually create my DB class with perl and communicate with the CGI module? What I wanted to do is create my pages in php and use some perl for functions to handle the Dababase structure. For me, perl is really good with hashes ref. Php, not so much..

      Mojolicious::Lite!!! If you really want to do most of your work in the templates (as is done in a typical PHP script), you can do that here too. But it really supports (and encourages) a more healthy separation of concerns. Take a look at the docs and see if it's a good fit.


      Dave

      Running PHP and Perl in one webpage will surely degrade the performance of the webserver. For each call to a Perl-routine from PHP, the web-server will have to start a new instance of Perl. Multiply that with the number of pages that can get simultaneously accessed and the performance crawls down to a halt.

      CountZero

      A program should be light and agile, its subroutines connected like a string of pearls. The spirit and intent of the program should be retained throughout. There should be neither too little or too much, neither needless loops nor useless variables, neither lack of structure nor overwhelming rigidity." - The Tao of Programming, 4.1 - Geoffrey James

      My blog: Imperial Deltronics

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others wandering the Monastery: (5)
As of 2014-10-02 11:32 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    What is your favourite meta-syntactic variable name?














    Results (55 votes), past polls