Rest assured that the only reason I had that dirty
$one in global was because I stripped the script to the bare minimum to try and figure out what was going wrong.
The only globals the entire script has are
$dbh, $sth, $rc for database calls, and
$conf and
%conf.
$conf contains the hash from my config file and
%conf is my CGI params grabbed from
CGI->vars.
I think for now I'm going to experiment with both
cLive ;-)'s suggestion of containing my config data in a module of it's own, and I think I'll also try out setting the
$conf reference to a global.
my $main::conf;
unless ($::conf = do ('/home/4220/straitwa/www.straitway.net/shop_34/c
+on
+f.pl')) {
die ("Could not open config file");
}
I'd appreciate anybody's opinion on whether having five global variables is a bad thing. - I mean, should I really aim to have no globals or is that overkill.
I realise that my whole problem here was my misunderstanding that
my $foo declared in the main package doesn't make it the same as $main::foo
I greatly appreciate everyone's help here,
Thanks!
fireartist