[Date Prev][Date Next][Thread Prev][Thread Next] [Search] [Date Index] [Thread Index]

[MacPerl] Embedding perl into my C application



First of all thanks to Matthias Ulrich Neeracher for the
great work with MacPerl, and I apologize to the readers
if my question is trivial, but I am new at both Perl and
MacPerl, and I have looked at the FAQ and the mailing
list's archives, so far to no avail. Here is the question.

I need to write my own Mac application in C, using
Metrowerk CodeWarrior. I also need to embed a Perl
interpreter into my application, so that I can execute
Perl scripts from my program (it is a Web application
for which I will use mainly the libwww-perl5 routines).

I would like to do as the perlembed document instructs,
but where can I get the perl source that will compile on
CW (miniperlmain.c, perl.h, EXTERN.h, etc...)? The Unix
source requires of course a lot of adjustments and I am
not familiar enough with porting Unix programs to the Mac.
And, what perl library (libraries) do I need? Do they
exist for the Mac? (Of course Matthias must have done
this, but are they available?) Where could I get them?

Is there an easier/more direct way to do this?
Any help would be greatly appreciated!

If all this fails, I guess I would have to resort to
calling perl droplets from my C application with exec()
or system(), and invoke MacPerl 5 to compile and
execute them. However, I am afraid this would be inefficient
and perhaps even problematic as I understand that the exec()
implementation in CW (or on Macs in general) is shaky.
Not to mention complications for passing parameters.

Thank you very much!
Filippo

PS - you can assume PPC, CW 8, System 7.5.3, etc...



Filippo Menczer

Email:      fil@cs.ucsd.edu
Homepage:   http://www-cse.ucsd.edu/users/fil/
Snail mail: UCSD CSE, La Jolla, CA 92093-0114, USA
Lab phone:  (619) 534-8187
Home phone: (619) 587-7005
Fax:        (619) 534-7029