bgiii has asked for the wisdom of the Perl Monks concerning the following question:

I have created an installable modules using Inline::C. It works swell. Builds, installs, tests OK. But, if this module is run from w/in an embedded Perl interpreter, it fails. There may be another way around it, but I solved the problem by changing my modules as follows:

require DynaLoader;
our @ISA = qw(Exporter DynaLoader);
bootstrap My::Module;

Now I can run the module from w/in embedded code as I desired. I was very happy. But, when I moved to a different machine, and went to build the module there, there is no .so file for My::Modules, so the bootstrap command fails. I can get the thing to make if I comment out the bootstrap line, but this is now not a module I can get to run under embedded perl.

So my question is: is there a way I can leave the bootstrap command in, but not have it even attempted when I am attempting the initial make? I mean something like

bootstrap My::Module if XXX;

where XXX is unknown.

Thanks for any help, oh wise ones.

  • Comment on bootstrap in a new module going 4 paws to moon

Replies are listed 'Best First'.
Re: bootstrap in a new module going 4 paws to moon
by ysth (Canon) on Jan 17, 2006 at 08:50 UTC
    I'm not sure exactly under what circumstances you think it's ok for the .so to not be there, but does:
    eval { bootstrap My::Module };
    help you?
      If I have previously installed it, the .so is there. This is exactly what happened. As I said, I was trying to install this code base on a different machine, where the .so files had not yet been installed.

      What happened is that I had built, installed and tested all of this and then tried to run from w/in embedded Perl. That's when I had to go back to 20 or so modules and add the bootstrap line.

      But I think the eval thing did the trick. Thanks!