http://www.perlmonks.org?node_id=547867

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

hello monks,

I run a perl subroutine( call it A) which in turn issues a system call thereby calling a c executable (call it B). Now this C executable(B) has perl embedded in it. the newly developed perl interpreter (called by B ,say I name it as D ) has to make use of another perl code segment (D)which loads library at run time .

this perl code segment(D) has commands like "use UserLib.pm " and UserLib.pm has "use POSIX ; ".

Now when I run A ,i get the following error:

Can't Load POSIX.Dyanmic loading not available in this perl. You may need to build a new perl executable which supports dynamic loading or has the POSIX module statically linked to it.

please explain in layman's terms what could be done to solve this problem and also there can't be any modifications in the procedure i.e I need to call a c executable which has perl embedded in it from another perl subroutine.

thank you.

Replies are listed 'Best First'.
Re: dynamic loading
by kvale (Monsignor) on May 07, 2006 at 07:11 UTC
    Although you have a complex calling sequence, the real problem is with your embedded perl. Whoever embedded perl in the C program did not include the dynamic loading code library appropriate to your operating system. What this means is that pure perl modules, such as UserLib.pm will work, but modules that use C libraries, such as POSIX, will not be able to load and execute properly.

    If you are a layman, talk to the person who wrote the C program and ask them to configure the embedded perl to use dyamic loading and to build the C app with the above mentioned libraries for dynamic loading.

    -Mark

      I am the one who wrote the c code . Thank you for your suggestions. This is really great. I get replies so quickly. Thats awesome.
Re: dynamic loading
by vkon (Curate) on May 07, 2006 at 07:23 UTC
    this exactly described in perldoc perlembed, search for your error
      Thank you.