search for books and compare prices
Tables of Contents for Extending and Embedding Perl
Chapter/Section Title
Page #
Page Count
preface
xiii
 
acknowledgments
xv
 
about this book
xvi
 
author online
xix
 
about the cover illustration
xx
 
C for Perl programmers
1
23
Hello, world
1
1
The C compiler
2
1
Header files
3
1
The main function
4
2
Variables and functions
6
4
Function parameters
6
1
Automatic variables
7
1
Global variables
8
1
Static variables
9
1
Data types
10
6
C types
11
4
Types defined in Perl
15
1
Casting
16
1
Control constructs
17
3
Statements and blocks
17
1
The break and continue statements
18
1
The switch statement
19
1
Macros and the C preprocessor
20
3
Library functions
23
1
Summary
23
1
Extending Perl: an introduction
24
27
Perl modules
24
6
Module distributions
26
4
Interfacing to another language: C from XS
30
8
The Perl module
30
1
The XS file
31
1
Example: ``Hello, world''
32
4
Return values
36
1
Arguments and return values
37
1
XS and C: taking things further
38
6
Modifying input variables
38
1
Output arguments
39
1
Compiler constants
40
4
What about Makefile.PL?
44
3
It really is a Perl program
47
1
Interface design: part 1
47
3
Status and multiple return arguments
48
1
Don't supply what is already known
48
1
Don't export everything
49
1
Use namespaces
49
1
Use double precision
49
1
Further reading
50
1
Summary
50
1
Advanced C
51
19
Arrays
51
2
Pointers
53
5
Pointers and arrays
55
2
Pointers to functions
57
1
Strings
58
2
Arrays of strings
59
1
Structures
60
2
File I/O
62
1
Memory management
63
5
Allocating memory at runtime
64
1
Altering the size of memory
65
1
Manipulating memory
65
2
Memory manipulation and Perl
67
1
C Traps for the Perl programmer
68
1
Further reading
69
1
Summary
69
1
Perl's variable types
70
30
General concepts
70
4
Reference counting
71
1
Looking inside: Devel::Peek
71
1
The flag system
72
2
Scalar variables
74
7
The SvNULL type
74
2
SvRV: references
76
1
SvPV: string values
76
2
SvPVIV: integers
78
1
SvPVNV: floating-point numbers
79
1
SvIV and SvNV
80
1
SvOOK: offset strings
80
1
Magic variables: SvPVMG
81
4
Array variables
85
2
Hashes
87
4
Globs
91
3
Namespaces and stashes
94
1
Lexical ``my'' variables
95
1
Code blocks
96
3
Important CV flags
97
2
Further reading
99
1
Summary
99
1
The Perl 5 API
100
63
Sample entry
101
1
SV functions
101
31
Special SVs
101
2
Creating SVs
103
7
Accessing data
110
9
Manipulating data
119
5
String functions
124
5
References
129
3
AV functions
132
12
Creation and destruction
132
4
Manipulating elements
136
6
Testing and changing array size
142
2
HV functions
144
6
Creation and destruction
144
2
Manipulating elements
146
4
Miscellaneous functions
150
12
Memory management
150
5
Unicode data handling
155
3
Everything else
158
4
Summary
162
1
Advanced XS programming
163
68
Pointers and things
164
2
Filehandles
166
1
Typemaps
167
2
The argument stack
169
1
C structures
170
13
C structures as black boxes
170
6
C structures as objects
176
3
C structures as hashes
179
4
Arrays
183
19
Passing numeric arrays from Perl to C
183
7
Passing numeric arrays from C to Perl
190
2
The Perl Data Language
192
6
Benchmarks
198
1
Character strings
199
3
Callbacks
202
7
Immediate callbacks
203
3
Deferred callbacks
206
1
Multiple callbacks
207
2
Other languages
209
14
Linking Perl to C++
209
7
Linking Perl to Fortran
216
7
Linking Perl to Java
223
1
Interface design: part 2
223
1
Older Perls
224
1
What's really going on?
225
5
What does xsubpp generate?
226
4
Further reading
230
1
Summary
230
1
Alternatives to XS
231
23
The h2xs program
232
1
SWIG
233
5
Data structures
236
2
The Inline module
238
9
What is going on?
239
1
Additional Inline examples
240
5
Inline and CPAN
245
1
Inline module summary
246
1
The PDL::PP module
247
4
The pd file
248
1
The Makefile.PL file
249
2
Pure PDL
251
1
Earlier alternatives
251
1
Further reading
252
1
Summary
253
1
Embedding Perl in C
254
14
When to embed
254
1
When not to embed
255
1
Things to think about
255
1
``Hello C'' from Perl
255
2
Compiling embedded programs
257
1
Passing data
257
2
Calling Perl routines
259
6
Stack manipulation
261
2
Context
263
1
Trapping errors with eval
263
1
Calling Perl methods in C
264
1
Calling Perl statements
265
1
Using C in Perl in C
265
1
Embedding wisdom
266
1
Summary
267
1
Embedding case study
268
9
Goals
268
1
Preparing the ground
269
1
Configuration options
270
3
Testing options
273
3
Binary options
273
1
Quad-state options
274
1
String options
275
1
Summary
276
1
Introduction to Perl internals
277
27
The source tree
277
2
The Perl library
277
1
The XS library
278
1
The I/O subsystem
278
1
The Regexp engine
278
1
The parser and tokenizer
278
1
Variable handling
279
1
Runtime execution
279
1
The parser
279
3
BNF and parsing
279
2
Parse actions and token values
281
1
Parsing some Perl
281
1
The tokenizer
282
3
Basic tokenizing
282
2
Sublexing
284
1
Tokenizer summary
285
1
Op code trees
285
10
The basic op
285
1
The different operations
286
1
Different flavors of ops
286
2
Tying it all together
288
2
PP Code
290
3
The opcode table and opcodes.pl
293
1
Scratchpads and targets
293
1
The optimizer
294
1
Op code trees summary
294
1
Execution
295
1
The Perl compiler
295
8
What is the Perl compiler?
296
1
B:: modules
296
3
What B and O provide
299
1
Using B for simple tasks
300
3
Further reading
303
1
Summary
303
1
Hacking Perl
304
20
The development process
304
2
Perl versioning
304
1
The development tracks
305
1
The perl5-porters mailing list
305
1
Pumpkins and pumpkings
305
1
The Perl repository
306
1
Debugging aids
306
11
Debugging modules
307
1
The built-in debugger: perl -D
307
3
Debugging functions
310
1
External debuggers
310
7
Creating a patch
317
4
How to solve problems
317
1
Autogenerated files
318
1
The patch itself
319
1
Documentation
320
1
Testing
320
1
Submitting your patch
320
1
Perl 6: the future of perl
321
2
A history
321
1
Design and implementation
322
1
What happens next
323
1
The future for Perl 5
323
1
Further reading
323
1
Summary
323
1
Perl's typemaps
324
24
Further reading
348
2
Perl API index
350
5
index
355