I had been programming off and on with Perl for over ten years when I gave PHP a try for about a year. I stopped when I spent a day debugging a problem I wouldn't have had in Perl (caused by PHP's lack of lexical scoping).

One thing I found somewhat easier about PHP is how it reports errors. If the code I wrote wouldn't even parse, I'd get an error right there in the browser. With my Perl projects, the browser's blank, and the error is in the error log. (Prepare now for a chorus of monks with a solution to this problem, perhaps it's CGI::Carp's fatalsToBrowser, which I've heard of often and used never.)

One gripe I had with PHP (besides the really galling lack of lexical scoping) is that the language has pretty obviously been put together by people who didn't talk to each other. Functions are named with underscore_style in places, lowercaseAndCaps in other places. There's database functionality built in, but the ubiquitous DBI is superior (in my opinion). You've clearly spent more time with PHP than I have, so I'd expect you to know its warts better than I do.

I'd suggest taking something (small) you've written before and rewriting it in Perl. I'd also suggest you give the MVC pattern a try. I like it. If the small rewrite goes well, rewrite something large. If that goes well, write something new.

We'll be here to help. We can argue the technical merits of the languages, but the community is the killer feature.


In reply to Re: Migrating from PHP to Perl for the web. by kyle
in thread Migrating from PHP to Perl for the web. by KurtSchwind

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.