Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight

comment on

( #3333=superdoc: print w/replies, xml ) Need Help??

Hrm. Embperl perhaps, though for small to middle sized sites, HTML::Template is preferable.

PHP has mysql functions built in, so DBI and the mysql driver are a good pick. However, the DBI framework is again a little bit more involved, and is object oriented, so perhaps not the best pick for a PHP convert. Anyone know of a purely procedural equivalent, mysql only?

Other than that, PHP has some HTML manipulating functionality, and that's about it. has the escapeHTML function, and HTML::Scrubber I believe should do the rest.

The pretty much covers functionality that PHP posesses that Perl doesn't, but it doesn't cover that you don't have to import any of these things in PHP. You may consider creating a wrapper module to include this functionality, or even provide same name functionality for the Perl scripts. Then again, if you're teaching classes, then teaching the language and the modules is probably better than making them learn a throw off framework designed to imitate another language.

There are some difference that you'll need to make PHP developers aware of, kind of a cheat sheet.

  • Ignore function prototypes in Perl, they don't work like you think they work. This is one of two features that I miss in Perl when coming back from PHP.
  • foreach my $alias (@array) creates an alias to the @array entry. Mutiple aliases in the loop aren't possible. (In PHP you can do for ($hash => $key, $value) {...} to do multiple aliases)
  • Arrays and Hashes are not the same data structure, and hashes do not preserve order.
  • Perl has a debugger! Rejoice!

Light a man a fire, he's warm for a day. Catch a man on fire, and he's warm for the rest of his life. - Terry Pratchet

In reply to Re: Help with PHP-to-Perl CPAN bundle by erikharrison
in thread Help with PHP-to-Perl CPAN bundle by gunzip

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, 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, 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.
  • Log In?

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

    How do I use this? | Other CB clients
    Other Users?
    Others imbibing at the Monastery: (4)
    As of 2020-02-24 00:46 GMT
    Find Nodes?
      Voting Booth?
      What numbers are you going to focus on primarily in 2020?

      Results (104 votes). Check out past polls.