develooper Front page | perl.perl5.porters | Postings from November 2003

question about load_module

Thread Next
Jamie Le Tual
November 10, 2003 12:51
question about load_module
Message ID:

I created a module using "h2xs -n LoaderTest", then tacked the following 
XSUB at the end:

doLoad(SV *package_name)
    load_module(0, package_name, Nullsv);

Then built and installed it (yeah, I'm too lazy to write a test) ...
perl Makefile.PL
make install

I fired up my trusty debugger, perl -de1
  DB<1> use LoaderTest

  DB<2> LoaderTest::doLoad('Data::Dumper')
Signal SEGV at /usr/lib/perl5/5.6.1/ line 1399
        DB::DB called at -e line 1
[jamie@berne jamie]$


Just for kicks, I created an embedded perl interpreter, and tried

Perl_load_module(my_perl, 0, package_name, Nullsv);


Perl_load_module_nocontext(0, package_name, Nullsv);

None of which got me any farther.

I then had the idea of seeing if any clever people had already used 
load_module, so I looked through the source of mod_perl. Seems they 
build a "require %s" type of thing and eval_sv() that instead....

is load_module broken? Badly documented? Am I such a clod that I've 
missed something obvious?

Will work for clue,

Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About