I am receiving the following error:
Can't call method "func" on an undefined value at
C:\Inetpub\scripts\convertOptran.pl line 382, line 532.
And the offending line of code is marked by ' <-------------- BAD CODE! BAD!'. I
checked the passed arguments, which all check out. I do not see any errors connecting
to the database server, nor installing the mysql driver. But the moment I try to see
what DBs and tables are available, it gives me the offending (and I am very offended)
error.
Any help?!
Thanks in advance,
Ward
sub openDatabase {
my $driver = shift;
my $database = shift;
my $user = shift;
my $password = shift;
my $hostname = shift;
my $port = shift;
print header;
my $dsn = "DBI:$driver:database=$database;host=$hostname;port=$port";
eval{ $dbh = DBI->connect($dsn, $user, $password); };
print $@ if $@;
eval{ $drh = DBI->install_driver("mysql"); };
print $@ if $@;
my @tables;
eval{ @tables = $dbh->func('_ListTables'); };
<-------------- BAD CODE! BAD!
print $@ if $@;
my @dbs;
eval{ @dbs = $dbh->func($hostname,$port,'_ListDBs'); };
<-------------- BAD CODE! BAD!
print $@ if $@;
}