Hi all,

I'm trying to include a different file in a program depending on whether
it's in a development or production environment, but the 'use lib'
parameter doesn't include the value of the variable I want it to
interpolate.  I'm running the following simplified script:

----
#!/usr/bin/perl
$DEV_OR_PROD = 'dev';
$LIB_LOC = "path/" . $DEV_OR_PROD . "/lib";
print $LIB_LOC . "\n";
use lib "/foo/$LIB_LOC/bar";
require 'file-to-include.pl';
----

>From which I get:

----
path/dev/lib
Can't locate file-to-include.pl in @INC (@INC contains: /foo//bar
/usr/lib/perl5/5.00503/i386-linux /usr/lib/perl5/5.00503
/usr/lib/perl5/site_perl/5.005/i386-linux /usr/lib/perl5/site_perl/5.005 .)
at test.pl line 6.
----

The first line ("/path/dev/lib") is perfect, but you'll notice the first
@INC value is "/foo//bar", which is obviously missing the "path/dev/lib"
part that is stored in $LIB_LOC.  I've consulted various references, but
can't seem to get an answer.  The same behavior happens on version 5.005_03
for Linux and version 5.6.1 for Win32.  What am I doing wrong?

-------------------------------------------------------
Ted Behling, Web Application Developer
Monarch Information Systems, Inc.

43 Folly Field Road, Unit 4
Hilton Head Island, SC 29928-5434
E-mail: mailto:[EMAIL PROTECTED]
Toll-free Phone & Fax: 1-800-842-7894
Local or Outside the USA: 1-843-842-7894
Cell Phone: 843-816-7895 (urgent issues)
Cell Phone E-mail: mailto:[EMAIL PROTECTED]
  (limited to 116 letters; also goes to normal e-mail)
Web site: http://www.monarchis.net
-------------------------------------------------------

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to