I am using strict and I only have one $foo variable. I will try use vars.
----- Original Message -----
From: "John Porter" <[EMAIL PROTECTED]>
To: "Boston Perl Mongers" <[EMAIL PROTECTED]>
Sent: Friday, February 09, 2001 9:15 AM
Subject: Re: [Boston.pm] grab bag of fun
: Matthew J. Brooks wrote:
: > Now if only this script I'm writing would let me just use $foo after
: > requiring a config file instead of having to use $main::foo I'd be
happy.
: > my ($foo, $bar, $foobar,
$it_was_fubar_until_we_used_perl_to_fix_it);
: > require '/home/mjbrooks/test/conf/foo.conf';
: > and and I took away the "my"'s the were in the .conf file ...
: > There are just a couple of strange instances where saying
: > $foo yields nothing, but $main::foo has the information from the config
: > file...
:
: Just a guess -- you're not use'ing strict.
: You've got globals and lexicals with the same name.
: What you really want is globals; so
: use vars qw( $foo );
: at the top (and don't my $foo), and then all accesses
: to $foo are implicitly to $main::foo (as long as you
: don't change packages).
:
: --
: John Porter
:
: Night came uninvited, pierced through with stars
: