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.