I find comparing two languages with "toy scripts" to not be very exciting. You are not going to really see the strengths and weaknesses until you delve deeper. Consider how database and interface abstraction layers influence your decision. That's where the excitement begins. ;)

I have been coding in PHP for the past week and so far ... it's not so bad. I have been using the Smarty templating engine and have been having very good results.

Why am i using PHP? First, because the original site was written with it. Second, my client wants PHP. Personally, I would rather use mod_perl, but (for me so far) PHP has been more fun than JSP, ASP, and Cold Fusion combined. If you are serious about PHP, i recommend O'Reily's Programming PHP and Smarty. PEAR looks promising as well.

What have i found the differences/similarities between Perl and PHP to be so far?

All in all, i can't really knock PHP, but if i have a choice - mod_perl!

jeffa

Blessed is the PHP programmer who grokketh Perl.

In reply to (jeffa) Re: PHP vs Perl code compare by jeffa
in thread PHP vs Perl code compare by mandog

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.