Translation guide for Perl and PHP MAR 17 2004
Translation guide for Perl and PHP. Would be great if this included several other popular languages.
Translation guide for Perl and PHP. Would be great if this included several other popular languages.
PLEAC is an collaborative effort to translate the Perl Cookbook across various languages (python and ruby are about half done).
There is also Doug Bagley's Great Computer Language Shootout that not only gives sample code for each test, but also tells you how it compares in memory and CPU usage.
This thread is closed to new comments. Thanks to everyone who responded.
Front page
About + contact
Site archives
Ads by The Deck
And more at Amazon.com
More listings on the Job Board
Hosting provided EngineHosting
Laurie27 17 200412:27PM
This is written very much from a Perl programmer's perspective -- it lists things you do in perl, and how you would do the exact equivalent in PHP. As a result, it ends up making PHP look rather long and convoluted compared to Perl, when in my experience the opposite is the case (although PHP lacks some of Perl's power).
For instance, it shows the PHP translation of the Perl idiom "while (list($key,$value) = each($h))" when in fact PHP's equivalent is the much simpler "foreach($h as $key => $value)".
As another example: it uses the Perl CGI library to generate HTML, which makes it look simpler -- and it is, if all you want to do is generate very simple HTML widgets. But it ignores the flexibility of being able to include big wodges of HTML in your PHP without needing to quote anything, which is one of the things that makes PHP so nice for writing web apps quickly.