Extending and Embedding PERL

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

See more details below
Available through our Marketplace sellers.
Other sellers (Paperback)
  • All (10) from $14.20   
  • New (2) from $102.88   
  • Used (8) from $14.20   
Close
Sort by
Page 1 of 1
Showing All
Note: Marketplace items are not eligible for any BN.com coupons and promotions
$102.88
Seller since 2014

Feedback rating:

(2)

Condition:

New — never opened or used in original packaging.

Like New — packaging may have been opened. A "Like New" item is suitable to give as a gift.

Very Good — may have minor signs of wear on packaging but item works perfectly and has no damage.

Good — item is in good condition but packaging may have signs of shelf wear/aging or torn packaging. All specific defects should be noted in the Comments section associated with each item.

Acceptable — item is in working order but may show signs of wear such as scratches or torn packaging. All specific defects should be noted in the Comments section associated with each item.

Used — An item that has been opened and may show signs of wear. All specific defects should be noted in the Comments section associated with each item.

Refurbished — A used item that has been renewed or updated and verified to be in proper working condition. Not necessarily completed by the original manufacturer.

New
New Brand new. excellent condition.

Ships from: Scarborough, Canada

Usually ships in 1-2 business days

  • Canadian
  • International
  • Standard, 48 States
  • Standard (AK, HI)
  • Express, 48 States
  • Express (AK, HI)
$215.00
Seller since 2014

Feedback rating:

(185)

Condition: New
Brand new.

Ships from: acton, MA

Usually ships in 1-2 business days

  • Standard, 48 States
  • Standard (AK, HI)
Page 1 of 1
Showing All
Close
Sort by
Sending request ...

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.

Read More Show Less

Editorial Reviews

From Barnes & Noble
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.

Slashdot.org
Aims to take the black magic out of understanding [Perl] . . . indispensable in gaining a good foothold on using Perl in, from, and around C.
Perl Journal
A masterpiece that will keep its value for years.
Perlmonks
Great for learning and great for reference, which is a combination other books often fail to achieve.
Perl Review
Everything related to Perl internals is found here . . . organized well, and is fine as a reference work.
From The Critics
Sometimes programmers are required to go outside the core of the Perl programming language to C routines or libraries in order to get their task done. This work was written in order to help software writers relate Perl and C. Assuming that readers are knowledgeable in Perl, they explain how to embed C into programs. In addition they also address cases where Perl is not the best base language and explore the opposite case of embedding Perl into C-based programs. Annotation c. Book News, Inc., Portland, OR
Read More Show Less

Product Details

  • ISBN-13: 9781930110823
  • Publisher: Manning Publications Company
  • Publication date: 8/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.

Read More Show Less

Table of Contents

Preface xiii
Acknowledgments xv
About this book xvi
Author online xix
About the cover illustration xx
1 C for Perl programmers 1
1.1 Hello, world 1
1.2 The C compiler 2
1.3 Header files 3
1.4 The main function 4
1.5 Variables and functions 6
1.6 Data types 10
1.7 Casting 16
1.8 Control constructs 17
1.9 Macros and the C preprocessor 20
1.10 Library functions 23
1.11 Summary 23
2 Extending Perl: an introduction 24
2.1 Perl modules 24
2.2 Interfacing to another language: C from XS 30
2.3 XS and C: taking things further 38
2.4 What about Makefile.PL? 44
2.5 Interface design: part 1 47
2.6 Further reading 50
2.7 Summary 50
3 Advanced C 51
3.1 Arrays 51
3.2 Pointers 53
3.3 Strings 58
3.4 Structures 60
3.5 File I/O 62
3.6 Memory management 63
3.7 C Traps for the Perl programmer 68
3.8 Further reading 69
3.9 Summary 69
4 Perl's variable types 70
4.1 General concepts 70
4.2 Scalar variables 74
4.3 Magic variables: SvPVMG 81
4.4 Array variables 85
4.5 Hashes 87
4.6 Globs 91
4.7 Namespaces and stashes 94
4.8 Lexical "my" variables 95
4.9 Code blocks 96
4.10 Further reading 99
4.11 Summary 99
5 The Perl 5 API 100
5.1 Sample entry 101
5.2 SV functions 101
5.3 AV functions 132
5.4 HV functions 144
5.5 Miscellaneous functions 150
5.6 Summary 162
6 Advanced XS programming 163
6.1 Pointers and things 164
6.2 Filehandles 166
6.3 Typemaps 167
6.4 The argument stack 169
6.5 C structures 170
6.6 Arrays 183
6.7 Callbacks 202
6.8 Other languages 209
6.9 Interface design: part 2 223
6.10 Older Perls 224
6.11 What's really going on? 225
6.12 Further reading 230
6.13 Summary 230
7 Alternatives to XS 231
7.1 The h2xs program 232
7.2 SWIG 233
7.3 The Inline module 238
7.4 The PDL::PP module 247
7.5 Earlier alternatives 251
7.6 Further reading 252
7.7 Summary 253
8 Embedding Perl in C 254
8.1 When to embed 254
8.2 When not to embed 255
8.3 Things to think about 255
8.4 "Hello C" from Perl 255
8.5 Passing data 257
8.6 Calling Perl routines 259
8.7 Using C in Perl in C 265
8.8 Embedding wisdom 266
8.9 Summary 267
9 Embedding case study 268
9.1 Goals 268
9.2 Preparing the ground 269
9.3 Configuration options 270
9.4 Testing options 273
9.5 Summary 276
10 Introduction to Perl internals 277
10.1 The source tree 277
10.2 The parser 279
10.3 The tokenizer 282
10.4 Op code trees 285
10.5 Execution 295
10.6 The Perl compiler 295
10.7 Further reading 303
10.8 Summary 303
11 Hacking Perl 304
11.1 The development process 304
11.2 Debugging aids 306
11.3 Creating a patch 317
11.4 Perl 6: the future of Perl 321
11.5 Further reading 323
11.6 Summary 323
A Perl's typemaps 324
B Further reading 348
C Perl API index 350
Index 355
Read More Show Less

Customer Reviews

Be the first to write a review
( 0 )
Rating Distribution

5 Star

(0)

4 Star

(0)

3 Star

(0)

2 Star

(0)

1 Star

(0)

Your Rating:

Your Name: Create a Pen Name or

Barnes & Noble.com Review Rules

Our reader reviews allow you to share your comments on titles you liked, or didn't, with others. By submitting an online review, you are representing to Barnes & Noble.com that all information contained in your review is original and accurate in all respects, and that the submission of such content by you and the posting of such content by Barnes & Noble.com does not and will not violate the rights of any third party. Please follow the rules below to help ensure that your review can be posted.

Reviews by Our Customers Under the Age of 13

We highly value and respect everyone's opinion concerning the titles we offer. However, we cannot allow persons under the age of 13 to have accounts at BN.com or to post customer reviews. Please see our Terms of Use for more details.

What to exclude from your review:

Please do not write about reviews, commentary, or information posted on the product page. If you see any errors in the information on the product page, please send us an email.

Reviews should not contain any of the following:

  • - HTML tags, profanity, obscenities, vulgarities, or comments that defame anyone
  • - Time-sensitive information such as tour dates, signings, lectures, etc.
  • - Single-word reviews. Other people will read your review to discover why you liked or didn't like the title. Be descriptive.
  • - Comments focusing on the author or that may ruin the ending for others
  • - Phone numbers, addresses, URLs
  • - Pricing and availability information or alternative ordering information
  • - Advertisements or commercial solicitation

Reminder:

  • - By submitting a review, you grant to Barnes & Noble.com and its sublicensees the royalty-free, perpetual, irrevocable right and license to use the review in accordance with the Barnes & Noble.com Terms of Use.
  • - Barnes & Noble.com reserves the right not to post any review -- particularly those that do not follow the terms and conditions of these Rules. Barnes & Noble.com also reserves the right to remove any review at any time without notice.
  • - See Terms of Use for other conditions and disclaimers.
Search for Products You'd Like to Recommend

Recommend other products that relate to your review. Just search for them below and share!

Create a Pen Name

Your Pen Name is your unique identity on BN.com. It will appear on the reviews you write and other website activities. Your Pen Name cannot be edited, changed or deleted once submitted.

 
Your Pen Name can be any combination of alphanumeric characters (plus - and _), and must be at least two characters long.

Continue Anonymously

    If you find inappropriate content, please report it to Barnes & Noble
    Why is this product inappropriate?
    Comments (optional)