SPUG: dynamic 'use lib'

Daryn Nakhuda daryn at marinated.org
Wed Mar 6 19:26:23 CST 2002


yeah, i'm hoping to leave it as a 'use' though, so I don't have to go 
through and change the rest of the code (add qualifications to the calls, 
etc). 

i'm trying to make a more generic version of a pretty large application, 
and one of the things i wanted to genericize is the libpath. 

since use is compile-time, I didn't figure what I was trying would work, 
but was wondering if there might be any other way to accomplish the same 
thing..

thanks.


On Wed, 6 Mar 2002, Aaron Paul wrote:

> you could do
> 
> $libdir = "/path/to/libs";
> require = "$libdir/library.pl";
> 
> Daryn Nakhuda wrote:
> 
> > is there a way to do something along the lines of:
> >
> > $libdir = "/usr/local/foo";
> > use lib $libdir;
> > use BAR; # which is in $libdir
> >
> > I get the following:
> > Empty compile time value given to use lib
> >
> >  - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
> >      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
> 

-- 



 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
     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