Whoo-hoo! Thanks again for a lightning-quick and highly useful solution.
Perhaps I should re-read what Programming Perl has to say about variable
scoping. Any other recommended reading?
At 01:41 AM 7/15/01 -0400, Jeff 'japhy' Pinyan wrote:
>On Jul 15, Ted Behling said:
>
>>Okay, that worked great until I added 'use strict vars'. Code now reads:
>
>Put a my ($LIB_LOC, $DEV_OR_PROD) outside (and before) the BEGIN block.
>
>>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;
>
>>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.
>
>Or declare the variables with 'use vars ...':
>
> use vars qw( $DEV_OR_PROD $LIB_LOC );
-------------------------------------------------------------------------
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]
Phone/Fax: 1-800-842-7894 Local or Outside the USA: 1-843-842-7894
Cell Phone (urgent issues): 843-816-7895
Cell Phone E-mail: mailto:[EMAIL PROTECTED] (116 letter limit)
Web site: http://www.monarchis.net
-------------------------------------------------------------------------
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]