RexJacobus
Programmer
The beginning of all our scripts look like this
use Mysql;
use Debug;
use Socket;
use strict;
require "include.pl";
require "tlib/subs.pl";
require "tlib/gs_db.pl";
require "tlib/common.pl";
inside gs_db.pl
i have the code
sub connect()
{ my ($script)=@_;
my $db_type = $'db_type;
my $database= $'database;
my $db_host = $'db_host;
if($script!="") {$'parent_script=$script; }
my $dbh = DBI->connect("DBI:${db_type}:${database}:${db_host}",$'db_user,$'db_password);
if(!$dbh)
{ &logError("Trying to connect","db: ${database}\@${db_host} user:$'db_user");
}
return($dbh);
}
But I am still getting the error
Global symbol "$dbh" requires explicit package name at C:/...
I understand use Strict means that $dbh must be declared but whu doesn't it accept the declaration in gs_db.pl?
I am trying to set up a dev environment on a brand new PC and all the scripts are fine and run elsewhere.
(I hate installing stuff, just let me program.)
jim
use Mysql;
use Debug;
use Socket;
use strict;
require "include.pl";
require "tlib/subs.pl";
require "tlib/gs_db.pl";
require "tlib/common.pl";
inside gs_db.pl
i have the code
sub connect()
{ my ($script)=@_;
my $db_type = $'db_type;
my $database= $'database;
my $db_host = $'db_host;
if($script!="") {$'parent_script=$script; }
my $dbh = DBI->connect("DBI:${db_type}:${database}:${db_host}",$'db_user,$'db_password);
if(!$dbh)
{ &logError("Trying to connect","db: ${database}\@${db_host} user:$'db_user");
}
return($dbh);
}
But I am still getting the error
Global symbol "$dbh" requires explicit package name at C:/...
I understand use Strict means that $dbh must be declared but whu doesn't it accept the declaration in gs_db.pl?
I am trying to set up a dev environment on a brand new PC and all the scripts are fine and run elsewhere.
(I hate installing stuff, just let me program.)
jim