location of mylib.pm

K

Konrad Blaszczyk

Hello

My script and my library are contained in the same directory. My
script uses my library:
use mylib;

I cannot execute my script from outside the directory it is located
since it cannot locate the mylib.pm.
How can I force my script to search the my library in the directory it
is located.

thank You for help
 
B

Ben Morrow

Quoth Konrad Blaszczyk said:
My script and my library are contained in the same directory. My
script uses my library:
use mylib;

I cannot execute my script from outside the directory it is located
since it cannot locate the mylib.pm.
How can I force my script to search the my library in the directory it
is located.

perldoc lib
perldoc FindBin

Ben
 
R

Ron Bergin

Hello

My script and my library are contained in the same directory. My
script uses my library:
use mylib;

I cannot execute my script from outside the directory it is located
since it cannot locate the mylib.pm.
How can I force my script to search the my library in the directory it
is located.

thank You for help

use lib 'path/to/your/library_dir';
use Mylib;
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,206
Messages
2,571,069
Members
47,678
Latest member
Aniruddha Das

Latest Threads

Top