【发布时间】:2009-03-25 18:28:32
【问题描述】:
my $now = &GetDate;
my $myHeader = &ReadMessage;
my $mySoftwareVersions = param('mySoftwareVersions');
my $q = new CGI;print $q->header();
use CGI::Carp(fatalsToBrowser);
getAllSoftwareVersions();
sub getAllSoftwareVersions
{
my $user = "zxxx";
my $passwd = "xxxx";
# my $tableName = "config_table";
# my $connection = DBI->connect("DBI:mysql:MESCI:hamysql02.stl.mo.boeing.com:18080", $user, $passwd, { AutoCommit => 0, RaiseError => 1}) or die "Couldn't connect to Database: " . DBI->errstr;
print "Must be connected\n\n";
print "\n\n";
# Error here.
my @Rows = &getConfigTableRows($connection, $config_table, $mySoftwareVersions );
my $total = @Rows;
print "total is ";
print $total;
上面的代码死了:
全局符号“$connection”需要明确的包名
编辑 这个问题与:
- https://stackoverflow.com/questions/682695/how-do-i-resolve
- https://stackoverflow.com/questions/681557/xml-cannot-be-displayed-error-from-perl-cgi-script-using-mysql
希望原始发帖人能够将其清理干净,以便更有意义,但这是我们目前所获得的,因此我们可以尝试提供帮助。
【问题讨论】:
-
这要好得多,但对于不了解您发布的其他问题的人来说,这仍然会让人感到困惑。请尽量不要对一个问题提出 3 个问题,只需使用底部的“编辑”链接逐步改进即可。
-
另外,您可能想阅读这篇文章,它的存在是为了阻止您陷入社区反应不佳的常见陷阱:stackoverflow.com/questions/469150/…
标签: perl