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

question about load_module

Thread Next
From:
Jamie Le Tual
Date:
November 10, 2003 12:51
Subject:
question about load_module
Message ID:
3FAFFA2C.5000602@kmtechnologies.com

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

void
doLoad(SV *package_name)
PPCODE:
    load_module(0, package_name, Nullsv);

Then built and installed it (yeah, I'm too lazy to write a test) ...
perl Makefile.PL
make
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/perl5db.pl line 1399
        DB::DB called at -e line 1
Aborted
[jamie@berne jamie]$

 >>Boom<<.

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

Perl_load_module(my_perl, 0, package_name, Nullsv);

and

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,
Jamie





Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About