.------[ Adriano Allora wrote (2002/10/30 at 14:04:55) ]------
 | 
 |  Hi to all,
 |  I've ever used PHP for my webworks, but I'm slowly learning Perl and I 
 |  recently discovered the cgi.pm and it seems enought simply and useful.
 |  What's the difference between using perl-cgi and php pages?
 |  And: is it very stupid to write a cgi wich creates all the web pages as 
 |  I could do with php?
 |  
 |  (I know all you are perl mongers and perl fanatics ;)  but please be 
 |  honest!)
 |  
 |  all'adr
 |  
 `-------------------------------------------------

    The big difference between php and Perl CGIs is that typically you
    create a .html page which is the display of the form, and the logic
    of how the data is processed ( i.e. send an e-mail, save data to a
    database, process an ecommerce order ) is handled by the Perl CGI. 

    This helps greatly to separate the look-n-feel of the display and the
    underlying logic. With PHP you typically put the logic within the
    HTML itself. IMHO this leads to very badly designed applications and
    applications that are very difficult to debug ( lots more files to
    read through ). 

    Granted from what I've read/seen you can do it both ways with both
    Perl and PHP.  You can write PHP without embedding it in HTML, and
    you can embed Perl in your HTML ( with Embed Perl )
    
    The main argument I use to usher people away from PHP is would you 
    rather master a general purpose language like Perl which can be 
    used for WWW things, sysadmin things, general application development, 
    etc or spend your time learning a basically web only language? The
    knowledge I gained in Perl for sysadmin reasons was 100%
    translatable to my days as a web programmer. 

    And for your second question I would advise against putting the HTML
    inside your CGIs, mod_perl applications, etc. If you use a template
    system like Template::Toolkit ( or any of the other templating
    systems ) when the marketing department mandates all of the website
    change to orange and black for Halloween you end up only modifying
    HTML templates and not having to muck with and possibly re-debug your 
    Perl CGIs. 

    Hope this helps. 

 ---------------------------------
   Frank Wiles <[EMAIL PROTECTED]>
   http://frank.wiles.org
 ---------------------------------


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to