|more useful options
poor mans embeddingby Ctrl-z (Friar)
|on May 25, 2004 at 12:28 UTC
The issues with embedding perl, distibuting perl apps without a perl install, perl runtime environments, perl plugins etc etc are well-covered here at the monastery.
I am not a C programmer and do not enjoy compiling code-bases like Perl, but as a perl coder the idea of embedding is appealing to me. PAR fulfills this to a certain extent, but real easy embedding could do a lot more than just application packaging.
As a proof-of-concept, I took the minimal C i knew and hacked together a surprisingly small .h file that can be used to link up to a precompiled perl library - perl58.dll or libperl.so.
The code in its current state is trivial and limited, but it has been tested on Mandrake 9.1 and Windows and works AOK running a fairly large, pure-perl web-app from the command line.
Thats the API as it stands now, effectively miniperlmain.c with cross-platform library loading...
I would appreciate any opinions from the real C coders amongst us on the viability and limits of this approach, and whether this is worth pursuing further. Of course ideas/improvements from anyone are welcome.
edit: removed link to tarball, see below for the basic gist