Beefy Boxes and Bandwidth Generously Provided by pair Networks
Come for the quick hacks, stay for the epiphanies.
 
PerlMonks  

comment on

( [id://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. CGI.pm 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!
Cheers,
Erik

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

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



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others admiring the Monastery: (4)
As of 2024-04-24 22:19 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found