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

I'm writing a perl wrapper for a third party C library. Unfortunately, the library authors have a global function called 'putq' that they use internally.
Well, putq is in another standard library on AIX.
When called from perl, the function that should be calling their putq is calling the one in the standard AIX library (and promptly core-ing).

I'm using XS/DynaLoader/Autoload etc... Is there a way to tell it which libraries to search first?

I realize that setting my LIBPATH (LD_LIBRARY_PATH for all you non-AIXers) env variable might work, but that would mean that every user that runs scripts using this module would have to change their environment. Any other ideas?

Replies are listed 'Best First'.
Re: DynaLoader Library Ordering
by rbc (Curate) on Dec 14, 2001 at 05:17 UTC
    Can't you change LIBPATH from within your perl script? $ENV{LIBPATH} .= "/new/path/to/lib"; something like that?
      Actually, I finally tested it and changing LIBPATH has no effect. So now I'm stuck for good. ;)