Okay, that worked great until I added 'use strict vars'. Code now reads:
----
BEGIN {
$DEV_OR_PROD = 'dev';
$LIB_LOC = "path/" . $DEV_OR_PROD . "/lib";
}
use strict vars;
use lib "/foo/$LIB_LOC";
require 'file-to-include.pl';
print $LIB_LOC;
----
And returns:
----
Variable "$LIB_LOC" is not imported at test.pl line 6.
Global symbol "$LIB_LOC" requires explicit package name at test.pl line 6.
BEGIN not safe after errors--compilation aborted at test.pl line 6.
----
Maybe I should've mentioned my use of 'strict vars' in the original
message, but I wanted to isolate the issue and didn't realize this would
come into play.
At 12:49 AM 7/15/01 -0400, Jeff 'japhy' Pinyan wrote:
>That one happens at COMPILE-TIME, before $LIB_LOC has a chance to be
>defined. Perhaps you should try:
>
> BEGIN {
> $DEV_OR_PROD = 'dev';
> $LIB_LOC = "path/" . $DEV_OR_PROD . "/lib";
> }
>
> use lib "/foo/$LIB_LOC/bar";
-------------------------------------------------------
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]