I am checking a Perl module ( test.pm ). I have been calling said module from my main script in different ways:
With use
:
use "C:/Usuarios/mitico/Documents/test.pm";
With lib
:
use lib "C:/Usuarios/mitico/Documents/test.pm";
use test.pm;
I've been trying various ways to use my module but it never locates it.
How do you use a module_?
A lib must be given the full path or a relative path from the site where the program that will use the module is located.
Thus, assuming that the module myModule.pm is in "C:\Users\mitico\Documents\myModule\lib":
or so, assuming the program is in "C:\Usuarios\mitico\Documents":
Do the test:
If no error comes out, it is that it does find the module myModule.pm
More information running perldoc lib and in the Perl forum in Spanish.
PS: Note that modern Windows can use forward slashes the same as Unix.