I'm pretty sure that the "module" here is not a Perl module, due to the reference to dlopen(), which is the C interface to shared libraries.

So what you need is the Perl module C::DynaLib. You can also try the FFI module which supports call-backs. They both allow you to attach to a shared library (or *.DLL under Windows) and call routines in it.

You can also try the Inline module which lets you, at run time, write C code to interface to the shared library, compile that C code into a shared library module that Perl can load, and then use that shared library to access the library you are interested in -- all without leaving the currently running script. Subsequent requests to use that C code only go through the compilation step if you have changed the C code. A pretty neat module but probably not as good for what you seem to want as the first two I mentioned.

All of these are available from CPAN. Go to search.cpan.org and search for any of these modules to browse the read-me files or documentation. Then download the latest version, probably as a *.tar.gz file. I hope you already have gunzip or GNU tar [and I assume that you already have tar since you mentioned dlopen()]. That way you can unpack the archive and do the standard:

perl Makefile.PL make test make install
to build, test, and install the Perl module.

Once the module is installed, you can type "perldoc C::DynaLib" (for example) to read the documentation that came with the module.

        - tye (but my friends call me "Tye")

In reply to (tye)Re: Load and unload modules ala dlopen(); by tye
in thread Load and unload modules ala dlopen(); by hydo

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.