Here is a very short checklist that I use to initially diagnose such problems:
- Make sure that the module that you think you’re referring to really is installed, and where you think it is. (Don’t assume.)
-
Issue the command, “perl -V” (with an upper-case “V”) and look at the library search-list to be sure that the specified directory really is on it. Remember that on a Unix system if you edit .bash_profile to modify the PERL5LIB environment variable, you must source .bash_profile to cause it to take effect, as the env command will subsequently confirm.
-
Ensure that the package-name you are referring to has been brought into the program via use or require. (See also: UNIVERSAL::require.)
-
In this particular case, where the package-name is obtained by means of a variable or string, use print STDERR this_expression to, once again, show (don’t assume ...) what this string actually contains at runtime.
-
Bear in mind the differences between where CPAN installs a package, as determined by its configuration, and where Perl at runtime looks for a package (see #2 above). The two are not the same and must agree. Otherwise, here is one of several ways that you will see that you can install a package but can’t call it.
HTH ...