SPUG: dynamic 'use lib'

Skahan, Vince vince.skahan at Boeing.COM
Thu Mar 7 10:04:24 CST 2002


# calculate our @INC path on the fly
# using the FindBin module to figure out
# where we're at, then look there with relative paths
# (see Perl5 Camel, page 415 for discussion)

use FindBin qw($RealBin);
use lib "$RealBin/../lib";
use lib "$RealBin/../etc";

# minimum versions required
use MyLibFromLib 2.15;
use MyCfgFromEtc 2.16;

--
----------- vince.skahan at boeing.com -----------
   Connexion by Boeing - Cabin Network


-----Original Message-----
From: Daryn Nakhuda [mailto:daryn at marinated.org]
Sent: Wednesday, March 06, 2002 4:59 PM
To: spug-list at pm.org
Subject: SPUG: dynamic 'use lib'



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