Since I’ve been building software on my own for the last few months, I’ve been able to choose my technologies. (As opposed to building for someone else; in which case you’re probably told what you can use.)
I’ve been extremely impressed with the amount of information and code freely available out there. By using Other Peoples’ Code or at least Other Peoples’ Knowledge, I’ve been able to dissolve many man-months of development time. Yay internets!
So I will try to give back as I solve problems, going forward, just by posting what I learn.
I suppose in the near term I’ll post here, but I have a site and domain name for whatever fruits come from my little computer-geek renaissance here. I’ll switch to that eventually.
Right now, I want to embed a perl interpreter in my Cocoa app and run some perl code. There are apparently two already-working ways to do this. There’s Camelbones and there’s Apple’s PerlObjCBridge.
I’ve downloaded the former and may go that route, but would rather use Apple’s doo-dad ’cause it’s built-in and relatively light-weight. Camelbones will let you write OSX GUI apps in perl; I just want to run faceless perl code from a Cocoa app and get its output.
So my problem is that every reference to PerlObjCBridge I’ve found through google only talks about how to access the ObjC runtime from perl, and provides no example of how to go the other way: make a perl object in ObjC and tell it “go”. Every reference. I admit, it’s super-cool that your little perl program can be a first-class OSX citizen, but just tell me which header to include to do the other and I’ll be on my way.
I’ll post when I figure it out.
[update] – Okay, it looks like the way to bridge to perl from Cocoa with PerlObjCBridge is to launch an NSTask to run OS X’s built-in perl interpreter in a sort of client/server relationship. An adequate solution, but not quite what I’m looking for. Found this by downloading the MathServerDO example from this article.