Extending and Embedding Perl
Extending and Embedding Perl by Tim Jenness and Simon Cozens
Manning Publications, 2003
Nothing instills more fear in the average Perl programmer than working with XS, Perl's technology for interfacing with eXternal Subroutines in other languages, most notably C. Calling C libraries from Perl is a delicate science, as is the related technique of embedding the entire Perl interpreter into an existing C program. Not every Perl programmer needs to do such things, but when faced with the task, it's hard work.
Written by two respected members of the Perl community, Extending and Embedding Perl attempts to address the needs of such programmers. It covers a lot of ground: XS, the Perl API, alternatives to XS, embedding, the Perl internals, compiling and the Perl development process.
I particularly liked the use of real examples (and working source code) when discussing various aspects of this technology. There are code snippets from Tk, Apache::mod_perl and the Perl sources. I also liked how the authors often would present an obvious solution to a problem, only to highlight its shortcomings, refine the initial solution and then present the improvement. This made the book's material real and useful.
I don't agree with the authors' assumption that they provide enough C in the two chapters they devote to the language. Programmers already competent in Perl and C will get the most from this book. If all you know is Perl, you'll likely struggle with the material. This is not really the authors' fault: XS isn't easy, and the style of C that's used within the Perl sources and the XS interface is somewhat obscure (that's being kind). I was amazed how often I found myself looking at the presented C code and shuddering. That aside, this book is a welcome addition to the arsenal of Perl books. It should help with demystifying XS and associated technologies. As to whether Extending and Embedding Perl is a book for every Perl programmer, I'd have to say it is not. However, if you do need it, you will find it an invaluable reference.
|Hacking a Safe with Bash||Jul 28, 2015|
|KDE Reveals Plasma Mobile||Jul 28, 2015|
|Huge Package Overhaul for Debian and Ubuntu||Jul 23, 2015|
|diff -u: What's New in Kernel Development||Jul 22, 2015|
|Shashlik - a Tasty New Android Simulator||Jul 21, 2015|
|Embed Linux in Monitoring and Control Systems||Jul 20, 2015|
- Hacking a Safe with Bash
- KDE Reveals Plasma Mobile
- Huge Package Overhaul for Debian and Ubuntu
- The Controversy Behind Canonical's Intellectual Property Policy
- diff -u: What's New in Kernel Development
- Shashlik - a Tasty New Android Simulator
- Home Automation with Raspberry Pi
- Embed Linux in Monitoring and Control Systems
- General Relativity in Python
- One Port to Rule Them All!