in reply to Using a different module version than the one installed

There's actually two directories that need to be added to @INC, the one that allows it to locate the .pm, and the one that allows it to locate the .so. The following will add both:

use FindBin qw( $RealBin ); use lib "$RealBin/../lib_ext";

(This also removes assumption that the PWD is the directory containing the script.)

Replies are listed 'Best First'.
Re^2: Using a different module version than the one installed
by syphilis (Archbishop) on Sep 02, 2022 at 06:17 UTC
    There's actually two directories that need to be added to @INC, the one that allows it to locate the .pm, and the one that allows it to locate the .so.

    Not in my experience.
    If you add a single location to @INC that will locate the .pm file, then that's all you need to do - assuming that you've located the .so in the location (relative to the .pm file) where perl will look for it.
    Of course, if you've placed the .so file in some other location (where perl won't look for it) then you will need to add a second path to @INC that will enable the .so file to be found by perl.

    I guess you are referring to the latter scenario.

    Cheers,
    Rob

      Yeah, nevermind. Both the pm and so are installed in the arch dir. I was confused. The error actually suggests an incorrectly installed module.

      That said, it is usually needed to add both the lib and arch dirs (because there are some modules in one and some modules in the other), and use lib adds both.