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 );
--
Jeff "japhy" Pinyan [EMAIL PROTECTED] http://www.pobox.com/~japhy/
I am Marillion, the wielder of Ringril, known as Hesinaur, the Winter-Sun.
Are you a Monk? http://www.perlmonks.com/ http://forums.perlguru.com/
Perl Programmer at RiskMetrics Group, Inc. http://www.riskmetrics.com/
Acacia Fraternity, Rensselaer Chapter. Brother #734
** Manning Publications, Co, is publishing my Perl Regex book **
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]