ActivePerl faq10 - Embedding and Extending

# Embedding and Extending

- NAME
- DESCRIPTION
  - How do I write an extension for ActivePerl?
  - How do I embed the Perl interpreter into my C/C++ program?
- AUTHOR AND COPYRIGHT

## NAME

ActivePerl-faq10 - Embedding and Extending

## DESCRIPTION

Techniques for Embedding and Extending ActivePerl

## How do I write an extension for ActivePerl?

Writing extensions in C or C++ for ActivePerl is identical to writing them for standard Perl. Consult the perlxstut document for complete information and pointers to other sources of information.

As a result of the oneperl effort, you no longer need to build ActivePerl from the source distribution to write or compile extensions. The Perl installation will detect your C compiler (currently, just Visual C++), and configure Perl to use it for compiling extensions.

Note that writing extensions in C or C++ is not easy. You need to have experience writing C programs for Windows platforms before you should even think about writing an extension.

## How do I embed the Perl interpreter into my C/C++ program?

Writing applications that contain Perl interpreters using ActivePerl is identical to writing them for standard Perl. Consult the perlembed document for complete information and pointers to other sources of information.

Note that the subject of embedding Perl interpreters inside applications is not a trivial one. You need to have experience writing C programs for Windows platforms before you should even think about writing an embedding Perl interpreters in your application.

NOTE: ActivePerl 5xx series builds had a different mechanism for embedding that was restricted to C++. This is no longer supported. The standard way to embed interpreters now supports all the functionality that used to be available only with C++, and then some. Use the mechanisms described in the perlembed documentation.

## AUTHOR AND COPYRIGHT

This FAQ was originally assembled and maintained by Evangelo Prodromou. It has been revised and updated by Brian Jepson of O'Reilly & Associates, David Grove, David Dmytryshyn, and David Sparks of ActiveState.

This FAQ is in the public domain. If you use it, however, please ensure that you give credit to the original authors.

ActivePerl FAQ - Embedding and Extending