Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic

Re^3: Embeding Perl in HTML the PHP way

by sundialsvc4 (Abbot)
on Sep 12, 2012 at 00:05 UTC ( #993088=note: print w/replies, xml ) Need Help??

in reply to Re^2: Embeding Perl in HTML the PHP way
in thread Embeding Perl in HTML the PHP way

Sure, Dave.   What I am referring to is the original concept that a PHP file would consist of HTML code with <?..php code here..?> tags stuck all through it.   For instance, if you wanted to generate an HTML table, you literally enclosed the <tr> tags and so-forth inside of an inline PHP loop.   The idea was that the output would consist of the un-bracketed (HTML) content interspersed with the output that may be produced by any PHP code wherever it appeared.   There was (by design, actually), no separation between the two.

That turned out to be a really bad idea, and the PHP community quickly moved away from it to adopt MVC strategies that are in many ways quite similar to what one now sees being done in Perl, et al.   The language itself also sprouted many new features, including many similarities to Perl and an openly-acknowledged copy of its regex technology.   I guess good word spreads fast... ;-)   Plus, the Zend folks include some really crackerjack coders.   PHP now does MVC along with the best of them, but the language emphatically didn’t start out that way.   (But hey, it sure seemed like a perfectly good idea at the time ...)

  • Comment on Re^3: Embeding Perl in HTML the PHP way

Replies are listed 'Best First'.
Re^4: Embeding Perl in HTML the PHP way
by aaron_baugher (Curate) on Sep 13, 2012 at 07:54 UTC

    I think you're being awfully generous in suggesting that "the PHP community" has moved away from the everything-in-one-file method. Outside of some big projects like Drupal and work being done by some elite coders, I think most PHP scripts still mash it all together. From what I see, although there are still plenty of CGI/HTML scripts out there, Perl is way ahead in that regard.

    That ability to toss a little code into an HTML file is what made PHP popular, after all. You didn't have to deal with file permissions or any of the stuff that made CGIs tricky at times; just stick your code in the page. That method makes large projects nearly impossible -- systems like Drupal and Wordpress are a mess, even with separation of code and layout -- but it makes the quick-and-dirty stuff quick. Take that away, and you're left with what, about a thousand inconsistently named functions?

    Aaron B.
    Available for small or large Perl jobs; see my home node.

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://993088]
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others rifling through the Monastery: (7)
As of 2018-06-21 10:50 GMT
Find Nodes?
    Voting Booth?
    Should cpanminus be part of the standard Perl release?

    Results (118 votes). Check out past polls.