Extending and Embedding PERL

Extending and Embedding PERL

by Tim Jenness, Simon Cozens
     
 

An explanation of how to expand the functionality and usefulness of the Perl programming language, this guide delves into the complex issues of using real code examples from the Perl source. Detailed is how to use Perl from C programs, such as writing interfaces to C libraries, implementing Perl callbacks for C libraries, and passing Perl hashes and arrays between

Overview

An explanation of how to expand the functionality and usefulness of the Perl programming language, this guide delves into the complex issues of using real code examples from the Perl source. Detailed is how to use Perl from C programs, such as writing interfaces to C libraries, implementing Perl callbacks for C libraries, and passing Perl hashes and arrays between Perl and C. Additionally, developers are provided with an API reference for the internal C interface to Perl and a reference on the typemap system.

Editorial Reviews

The Barnes & Noble Review
What do you do when there isn’t “More than One Way to Do It” in Perl? You reach beyond the core language, to a CPAN module and/or external C library -- or you write your own. But, as Tim Jenness and Simon Cozens observe, “writing extensions to Perl has historically been a bit of a black art.” In Extending and Embedding Perl, they empower experienced Perl scripters to perform all sorts of magic.

Jenness and Cozens begin with an overview of C for Perl programmers (while the language will seem barren to those unfamiliar with it, Perl’s syntax borrows heavily from C). They review how Perl modules work, how Perl interfaces with other languages via XS, how Perl variables are represented within Perl, and how to use the Perl 5 API to integrate C and Perl code. In most cases, the authors’ code examples aren’t just realistic: They’re actually taken from real XS modules and Perl sources.

Gradually, the authors move on to more complex integration tasks; for example, handling structures, arrays, and callbacks; linking to C++, Fortran, and (briefly) Java; and using alternatives to XS. Then, they switch gears, showing how to link an entire Perl interpreter inside a C program -- making that program more extensible, flexible, and easier to configure. (GIMP and gnumeric each use this technique extensively). This is slick stuff, well explained. Bill Camarda

Bill Camarda is a consultant, writer, and web/multimedia content developer. His 15 books include Special Edition Using Word 2000 and Upgrading & Fixing Networks For Dummies®, Second Edition.

Product Details

ISBN-13:
9781930110823
Publisher:
Manning Publications Company
Publication date:
08/28/2002
Pages:
384
Product dimensions:
7.38(w) x 9.32(h) x 0.85(d)

Meet the Author

Simon Cozens is an Open Source programmer and author. He has released over a hundred Perl modules including Email::Simple, Mail::Audit, Maypole, Plucene, and B::Generate. He's the co-author of Beginning Perl (Wrox) and Extending and Embedding Perl (Manning) and was the managing editor of Perl.com from 2001 to 2004. A graduate in Japanese from Oxford University, he now lives in Wales and enjoys Japanese and Greek food, bizarre music and fine typography.

Customer Reviews

Average Review:

Write a Review

and post it to your social network

     

Most Helpful Customer Reviews

See all customer reviews >