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