Extension modules
Two ways to do it: XS and SWIG.
SWIG is easy, but limited. When you want to do something SWIG doesn't support (e.g., binary data in strings) but Perl does, you're screwed.
http://www.swig.org/
XS is powerful, but more complicated.
You're making wrappers for C functions so that a Perl program can call them as though they were Perl functions.
Three big problems: converting data types, managing the argument and return stack, and correctly managing reference counts.
h2xs
can build skeletal wrapper modules for you.
perlguts
,
perlxs
, and
perlxstut
manpages.
Don't overlook Dean Roehrich's XS Cookbook in his DMR directory on CPAN.
perl-xs mailing list on perl.org (mail perl-xs-subscribe
@perl
.org)
Forward to
AUTOLOAD and closures
Back to
Games
Up to Stages of a Perl Programmer section
index
Up to YAPC 2000 course
index
YAPC 2000: Stages of a Perl Programmer - 38
Copyright © 2000, Nathan Torkington
All rights reserved.