Extending and Embedding PERL

Extending and Embedding PERL

Paperback

$36.65 $44.95 Save 18% Current price is $36.65, Original price is $44.95. You Save 18%.

Temporarily Out of Stock Online

Eligible for FREE SHIPPING

Overview

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 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.

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)

About 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.

Table of Contents

Prefacexiii
Acknowledgmentsxv
About this bookxvi
Author onlinexix
About the cover illustrationxx
1C for Perl programmers1
1.1Hello, world1
1.2The C compiler2
1.3Header files3
1.4The main function4
1.5Variables and functions6
1.6Data types10
1.7Casting16
1.8Control constructs17
1.9Macros and the C preprocessor20
1.10Library functions23
1.11Summary23
2Extending Perl: an introduction24
2.1Perl modules24
2.2Interfacing to another language: C from XS30
2.3XS and C: taking things further38
2.4What about Makefile.PL?44
2.5Interface design: part 147
2.6Further reading50
2.7Summary50
3Advanced C51
3.1Arrays51
3.2Pointers53
3.3Strings58
3.4Structures60
3.5File I/O62
3.6Memory management63
3.7C Traps for the Perl programmer68
3.8Further reading69
3.9Summary69
4Perl's variable types70
4.1General concepts70
4.2Scalar variables74
4.3Magic variables: SvPVMG81
4.4Array variables85
4.5Hashes87
4.6Globs91
4.7Namespaces and stashes94
4.8Lexical "my" variables95
4.9Code blocks96
4.10Further reading99
4.11Summary99
5The Perl 5 API100
5.1Sample entry101
5.2SV functions101
5.3AV functions132
5.4HV functions144
5.5Miscellaneous functions150
5.6Summary162
6Advanced XS programming163
6.1Pointers and things164
6.2Filehandles166
6.3Typemaps167
6.4The argument stack169
6.5C structures170
6.6Arrays183
6.7Callbacks202
6.8Other languages209
6.9Interface design: part 2223
6.10Older Perls224
6.11What's really going on?225
6.12Further reading230
6.13Summary230
7Alternatives to XS231
7.1The h2xs program232
7.2SWIG233
7.3The Inline module238
7.4The PDL::PP module247
7.5Earlier alternatives251
7.6Further reading252
7.7Summary253
8Embedding Perl in C254
8.1When to embed254
8.2When not to embed255
8.3Things to think about255
8.4"Hello C" from Perl255
8.5Passing data257
8.6Calling Perl routines259
8.7Using C in Perl in C265
8.8Embedding wisdom266
8.9Summary267
9Embedding case study268
9.1Goals268
9.2Preparing the ground269
9.3Configuration options270
9.4Testing options273
9.5Summary276
10Introduction to Perl internals277
10.1The source tree277
10.2The parser279
10.3The tokenizer282
10.4Op code trees285
10.5Execution295
10.6The Perl compiler295
10.7Further reading303
10.8Summary303
11Hacking Perl304
11.1The development process304
11.2Debugging aids306
11.3Creating a patch317
11.4Perl 6: the future of Perl321
11.5Further reading323
11.6Summary323
APerl's typemaps324
BFurther reading348
CPerl API index350
Index355

Customer Reviews

Most Helpful Customer Reviews

See All Customer Reviews