in reply to Dynamic dependencies

By the way, I've tried to set the LIBPATH variable at the beginning of my script, but it doesn't change anything...
Did you try
BEGIN { $ENV{LIBPATH}=... } use ...