Learning Perl Objects, References amp;amp; Modules [Electronic resources] نسخه متنی

اینجــــا یک کتابخانه دیجیتالی است

با بیش از 100000 منبع الکترونیکی رایگان به زبان فارسی ، عربی و انگلیسی

Learning Perl Objects, References amp;amp; Modules [Electronic resources] - نسخه متنی

Randal L. Schwartz

| نمايش فراداده ، افزودن یک نقد و بررسی
افزودن به کتابخانه شخصی
ارسال به دوستان
جستجو در متن کتاب
بیشتر
تنظیمات قلم

فونت

اندازه قلم

+ - پیش فرض

حالت نمایش

روز نیمروز شب
جستجو در لغت نامه
بیشتر
لیست موضوعات
توضیحات
افزودن یادداشت جدید














13.10 Using the Alternate Library Location



The
libraries are installed relative to the PREFIX
specified earlier. If Ginger used a PREFIX of
/home/ginger/Testing, you need to add the
appropriate directory below it to the search path. The use
lib
directive of:

use lib "/home/ginger/Testing/lib/site_perl";

does the right thing
to find the version-specific directory below it, as well as the
architecture-specific directory below it, if needed (usually for
architecture-specific files, such as compiled binaries).

You can also specify the include
directory on the command line with a -M option:

$ perl -Mlib=/home/ginger/Testing/lib/site_perl myproggy

or a -I option:

$ perl -I /home/ginger/Testing/lib/site_perl myproggy

or even by setting the PERL5LIB environment
variable (using sh-like syntax here):

$ PERL5LIB=/home/ginger/Testing/lib/site_perl; export PERL5LIB
$ ./myproggy

However, the downside of any of these methods (other than the
use lib method) is that they
require you to do something more than just execute the file. If
someone (or something) else (such as a coworker or a web server)
executes your program, it's unlikely that the proper
environment variable or command-line option will be present. Your
program will fail because it can't find your locally
installed module.

Use use lib, when you can. The
other ways are useful mainly for trying out a new version of an old
module before replacing the old module (and possibly breaking the
programs that use it).



/ 199