There's a project I'm working on (Paperboy RSS) that's
written in C, the simplest part of which is basically
applying XSLT to files with libxml2/libxslt. There's a
separate but related project written in Perl that's
going to use paperboy to do the heavy lifting but
needs to be able to let users define their own
XSLT/XPath functions. Since these functions are
user-defined I need to find some way to dynamically
load them into paperboy at runtime.
So my question is, what's the best/easiest way to do
this? Ideally paperboy would be dynamically loading
another C object file so that we could have a number
of these for writing xpath functions in different
languages; though that's not strictly a requirement.
I've had Apache2's libperl suggested to me, but my
weak google-fu can seem to find anything relevant on
that. Any guidance is appreciated.
Live well,
~wren
__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com
Ken Williams - 28 Jun 2005 20:15 GMT
Hi Wren,
Probably the first place to look is "perldoc perlembed", which
describes in general how to embed a perl interpreter in C programs.
There's no way that I know of for embedding chunks of perl (e.g.
subroutines) in C without embedding the entire perl interpreter too.
To do so would require compiling perl down to machine code, which isn't
possible in any clean way.
Apache2's libperl seems completely unrelated, except that it also
happens to be another example of someone embedding a perl interpreter
in a C program (the apache web server).
-Ken
On Jun 28, 2005, at 3:13 AM, wren argetlahm wrote:
> There's a project I'm working on (Paperboy RSS) that's
> written in C, the simplest part of which is basically
[quoted text clipped - 22 lines]
> Tired of spam? Yahoo! Mail has the best spam protection around
> http://mail.yahoo.com