I’ve been translating all the new perl and php scripts I write into Python and Ruby in order to learn more about those two languages. I checked some more example scripts into SourceForge, which might be useful for others who know one of these languages and want to learn a new one.
These scripts are available in perl, php, python, and ruby:
- How to query a REST web api using HTTP GET and parsing the XML response.
- How to make a system call and read the return value.
The REST Web Service PHP and Perl scripts don’t work in Mac OS X, because OS X doesn’t ship with Perl’s XML::Simple or PHP’s simplexml. More surprisingly, OS X doesn’t ship with Perl’s LWP module.
I’m starting to like Ruby more every day. It would be nice if Ruby and Python had a XML::Simple equivalent in their standard distributions.