SPUG: dynamic 'use lib'
ced at carios2.ca.boeing.com
ced at carios2.ca.boeing.com
Thu Mar 7 12:26:14 CST 2002
In article <20020306175434.A13745 at sabami.seaslug.org>,
Scott Blachowicz <scott at mail.dsab.rresearch.com> wrote:
> BEGIN {
> $libdir = "/usr/local/foo";
> use lib $libdir;
> use BAR;
> }
>> That is equivalent to the following:
>> BEGIN {
>> require lib;
>> lib::->import($libdir);
>> require BAR;
>> BAR::->import();
>> $libdir = "/usr/local/foo";
>> }
>> which is not quite good enough.
>> $libdir= needs to be in a BEGIN of its own.
Thanks for clarifying this. I was thinking like Scott
until "use lib $libdir" got a warning tag:
"Empty compile time value given to use lib at ..."
Rgds,
--
Charles DeRykus
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
POST TO: spug-list at pm.org PROBLEMS: owner-spug-list at pm.org
Subscriptions; Email to majordomo at pm.org: ACTION LIST EMAIL
Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address
For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest
Seattle Perl Users Group (SPUG) Home Page: http://seattleperl.org
More information about the spug-list
mailing list