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


in reply to Linking CPAN modules to specific library

There may be two separate problems. One, how the makefile flags and environment influence which libraries are linked against. See ld. Second, how the system finds libraries at runtime. See ld.so.

In any case, it looks like you are dealing with a mess. How to best clean it up depends on what options you have available as an admin.