in reply to c++ and perl

I haven't tried it, but Inline:CPP looks rather promising.

Update: I looked at the smoke results and reviews, perhaps it's not that promising. If the stuff you want is callable from C, try Inline::C instead.