Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??
Comparing PHP to a Perl CGI install is a bit flawed. To more accurately show the difference, you'd have to be comparing it to something like mod_perl + Mason. Mason example:
m <% print "Hi!" %>
vs PHP's:
<? print "Hi!" ?>
Mason lets you embed in an identical style to PHP, the barrier to entry is due to installed code base with most shared webservers. You want popular forum software? VBB and PHPBB are both PHP. You want a Bloggity blog blog blog? Wordpress, Moveable Type (Edit: MT is perl, woo :) ) and pretty much every other blog outside of Blosxom are PHP. You want a CMS? All those nuke etc sites that aren't based off of the PHP forums are PHP, with the exception of Drupal and Everything engine(Actually Drupal may be PHP now, I forget - point still stands).

I barely touch PHP, but run mod_php on my server due to all the other software that needs it(hosting friends sites and such). Unfortunately that precludes me from running mod_perl on the same server unless I have a high demand app that needs it. Running both simultaneously is only suggested if you enjoy using up all your ram. This also leads to me finding PHP equivilents to the applications I may prefer to have in perl, and jsut contributes to the problem. That, and laziness on my part for not coding more of it :p

One day, I'll probably mess around with Mason again, as the last I checked they didn't have native mod_perl2 support, so I didn't get farther then playing with it. It's really amazing how it addresses everything PHP can do, while adding in new paradigms like init and argument blocks, alongside being able to include other files with said arguments.

Random Examples of Mason awesomeness:
Simple site with dynamic includes:
<& ../check_auth &> <& ../header, title => "Welcome ".ucfirst(lc($user)) &> <& tabrow, active => 'main' &> <& ../iconcol, active => 'user' &> <div class="content"> Woo! Lookit me! I have content! (User/Main) </div> <& ../footer &>
The header included in above site:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> <HTML> <HEAD> <META http-equiv="Content-Type" content="text/html; charset=IS +O-8859-1"> <TITLE><% $basetitle %></TITLE> <& css &> </HEAD> <BODY> <%args> $css => "main.css" $cssinclude => 0 $title => "" </%args> <%init> my $basetitle = "MasonTest"; $basetitle .= ": $title" if $title ne ""; </%init>
Damnit, now I have to go play with this stuff again. :/

In reply to Re^2: The REAL reason for why they choose PHP over Perl. by Azhrarn
in thread The REAL reason for why they choose PHP over Perl. by Spidy

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (4)
As of 2024-04-25 14:44 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found