On Fri, Mar 05, 2004 at 01:09:38PM +0100 Marcus Holland-Moritz wrote: > On 2004-03-05, at 11:01:43 +0100, Tassilo von Parseval wrote: > > > Hi there, > > > > I am in the situation of having to use load_module(). According to > > perlapi, the first argument 'flags' is one of PERL_LOADMOD_NOIMPORT, > > PERL_LOADMOD_IMPORT_OPS and PERL_LOADMOD_DENY. What is the latter for? > > When I use it, it ends in a segfault. > > > > Having said that, my actual issue is that load_module() croaks when a > > non-existent module has been requested. Is there some way to trap that > > inside XS? > > You could try to play with the JMPENV_* macros from scope.h. > > Or you could just use eval_sv() to require the module, which > worked fine for me (in Convert::Binary::C, if you want to > have a look at the source).
The idea of eval_pv("require Module;", FALSE); did occur to me, but it feels a little bit like cheating. The longjmp() stuff looks interesting. Needless to say that I don't yet have an idea how to use it, but it's intriguing enough. Tassio -- $_=q#",}])!JAPH!qq(tsuJ[{@"tnirp}3..0}_$;//::niam/s~=)]3[))_$-3(rellac(=_$({ pam{rekcahbus})(rekcah{lrePbus})(lreP{rehtonabus})!JAPH!qq(rehtona{tsuJbus#; $_=reverse,s+(?<=sub).+q#q!'"qq.\t$&."'!#+sexisexiixesixeseg;y~\n~~dddd;eval