http://www.perlmonks.org?node_id=1008160


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

Replies are listed 'Best First'.
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