Imagine, you're given an old static html website to update. ~300 pages, classic header-navigation/body framed structure. A few Perl-based dyanmic content areas and a Perl-based search engine.

You immeditalely plan to lose the frames, and go to external css for style control and includes for global html element insertion.

Then you discover PHP. With its global "include path" setting, you won't have to worry about relative addressing in your external css links as documents get moved around the site. And with its "include" command, it's bound to be quicker than using SSI for includes. With the possibility of using variables, you can even imagine a scheme of automatically calling sub-section specific includes to vary the header content of pages.

BUT - Your Perl search engine can only output search results in html. So if you want to output search results formatted the same as the php pages, you're going to have to write a really inelegant template parser that does the work of php. The laternative is to show search rsults in a pop-up window, but that's even worse.

And THAT gets you thinking - hey, maybe this initial php/Perl issue is just the tip of the iceberg. Maybe by straying from Perl into PHP, you're setting yourself up for a whole host of nightmares down the road that will ultimately force you to choose between one or the other.

This is NOT Yet Another Perl vs PHP thread. The question is: can Perl and PHP co-exist in harmony on one website in order to exploit the best of both?




Forget that fear of gravity,
Get a little savagery in your life.

In reply to Using Perl & PHP together by punch_card_don

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



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.