Hi,
I faced same error in my script.
Error message in Apache error_log:
Use of uninitialized value $DBD::Pg::VERSION in concatenation (.) or string at /usr/lib64/perl5/vendor_perl/DBD/Pg.pm line 113, <HTML> line 535 during global destruction /path/to/xxxxx.pl
Is this issue caused by DBD::Pg? or by CGI::Session?
Environment:
CentOS 8
perl-interpreter-5.26.3-416.el8.x86_64,
perl-DBI-1.641-3.module_el8.1.0+199+8f0a6bbd.x86_64,
perl-DBD-Pg-3.7.4-4.module_el8.1.0+268+81255909.x86_64,
perl-CGI-4.38-2.el8.noarch,
perl-CGI-Session-4.48-11.fc28.noarch
and
CentOS 6
perl-5.10.1-144.el6.x86_64,
perl-DBI-1.609-4.el6.x86_64,
perl-DBD-Pg-2.15.1-4.el6_3.x86_64,
perl-CGI-3.51-144.el6.x86_64,
perl-CGI-Session-4.35-6.el6.noarch
Reproduce script:
#!/usr/bin/perl
use CGI;
use CGI::Session;
use CGI::Session::Driver::DBI;
my $dsn = 'dbi:Pg:dbname=database_name;host=localhost;';
my $usr = 'user_name';
my $pwd = 'password';
my $session_timeout = '+10m';
my $http_charset = 'UTF-8';
my $cgi, $session;
$cgi = new CGI;
my $sid = $cgi->cookie('CGISESSID')||$cgi->param('CGISESSID')||undef;
# CREATE TABLE tbl_session (
# session_id CHAR(32) NOT NULL PRIMARY KEY,
# a_session TEXT
# );
$session = CGI::Session->new('driver:PostgreSQL',$sid,{DataSource=>$dsn,
User=>$usr,
Password=>$pwd,
TableName=>'tbl_session' IdColName=>'session_id'});
my $cookie = $cgi->cookie(-name => 'CGISESSID',
-value => $session->id,
-expires => $session_timeout);
print $cgi->header(-cookie => $cookie,
-charset => $http_charset);
print "session->id:".$session->id."\n";
Thanks,