in reply to Help with PHP-to-Perl CPAN bundle
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!
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