location of mylib.pm

location of mylib.pm

am 23.11.2007 18:23:17 von Abanowicz Tomasz

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

Re: location of mylib.pm

am 23.11.2007 18:36:39 von Ben Morrow

Quoth Konrad Blaszczyk :
> 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

Re: location of mylib.pm

am 23.11.2007 18:43:01 von Ron Bergin

On Nov 23, 9:23 am, Konrad Blaszczyk wrote:
> 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;

Re: location of mylib.pm

am 23.11.2007 19:50:26 von Sherm Pendley

Konrad Blaszczyk writes:

> How can I force my script to search the my library in the directory it
> is located.

perldoc lib

sherm--

--
WV News, Blogging, and Discussion: http://wv-www.com
Cocoa programming in Perl: http://camelbones.sourceforge.net