If you have GD.pm in (for example) /home/username/lib/GD.pm (and your 'use lib' is /home/username/lib), then GD::Text::Align should be:
/home/username/lib/GD/Text/Align.pm
Either putting a "use lib '/home/username/lib';" line in your script or setting the PERL5LIB environment variable (probably in your .bashrc) will add that directory to the start of @INC (i.e. it'll be the first place the interpreter will look for modules.
I already use the "use lib '/home/username/lib';" line in my script but it still goes to the @INC first and then I haven't got what I want.
I do not have access to the configuration of the server I use. In this one case, I could ask the admin to make the change for me, but what else is possible when the admin refuses to make the change to the .bashrc?
Make sure that you put your 'use Module::Name' after 'use lib' and that the path in your 'use lib' line is definitely the correct path - perl will not check to see if that directory exists, only if /home/usename/lib/Module/Name.pm exists - obviously if the directory path is incorrect, it won't find that and continue down through @INC until it finds what it's looking for. It'll only throw an error if it can't find it anywhere.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.