Eric Christopherson wrote: > Oh, thanks for that. I would send that to the _main_ object. After > some digging, it appears that that is assigned to the variable > ruby_top_self (which isn't declared in a header), so I did this: > > EXTERN VALUE ruby_top_self; > ... > rb_funcall(ruby_top_self, rb_intern("send"), 2, > ID2SYM(rb_intern("require")), rb_str_new2("mysql")); > > This also works: > > rb_funcall(ruby_top_self, rb_intern("require"), 1, > rb_str_new2("mysql")); > > Why would one want to use send rather that calling require directly? Sorry, I meant the latter - using rb_funcall to invoke 'require', a bit like a 'send' in ruby, but not actually invoking the 'send' method. I don't know if there's a cleaner way to avoid the hidden ruby_top_self. -- Posted via http://www.ruby-forum.com/.