Re: Embedding Perl into CircleMUD

From: Patrick Dughi (dughi@imaxx.net)
Date: 09/07/02


>
> I am a little way into my scripting language quest, and I just wondered if
> anybody had already implemented Perl into their CircleMUD, and if said
> person would be willing to show me some working examples?  I do not need
> something that patches clean against bpl21 if you know what I mean, just
> something that I can fiddle with with the help of the Perl/C API and some
> basic examples and preferably some Perl code that you use to run through the
> embedded interpreter.
>

        Oooh, this is so easy to do, and yet, I don't have the time to
discuss all the little quirks that catch you up.  However, I can give you
the two pages that got me started on it (I also had a book which covered
this subject, but it wasn't very indepth, so skip that for now).

http://www.perldoc.com/perl5.6/pod/perlcall.html  and
http://www.perldoc.com/perl5.6/pod/perlembed.html

        In short, grab a copy of the perl library, perl.h and extern.h
(erm.. somewhere in the standard perl distribution), and link them in with
your program using some magic call to ExtUtils::Embed.

        Some of the regex searching using the match(), matches(), and
substitute() functions from that documentation has come in rather handy.

        In anycase though, you can probably get more examples that are
clearer than anything I can cut and paste from my own stuff.

        Just be ready to spend a bit of time getting things to
link/compile correctly, especially if you're using perl code which depends
on other modules.
                                        PjD

--
   +---------------------------------------------------------------+
   | FAQ: http://qsilver.queensu.ca/~fletchra/Circle/list-faq.html |
   | Archives: http://post.queensu.ca/listserv/wwwarch/circle.html |
   | Newbie List:  http://groups.yahoo.com/group/circle-newbies/   |
   +---------------------------------------------------------------+



This archive was generated by hypermail 2b30 : 06/25/03 PDT