----- Original Message ----- > Hi, > > I have tried the following test package: > > package Presa::H; > > use strict; > use warnings; > use diagnostics; > > use CGI (); > use CGI::Session (); > use DBI (); > > my $q = CGI->new(); > my $dbh = DBI->connect("DBI:mysql:database=presa", "root", undef, > {PrintError => 1, RaiseError => 1, AutoCommit => 1}); > > $Presa::H::sess = CGI::Session->new("driver:MySQL;id:MD5", $q, {Handle => > $dbh}); > > If I run this module, it gives me the following error: > > (in cleanup) Can't connect to data source , no database driver specified > and DBI_DSN env var not set at E:/usr/site/lib/CGI/Session/MySQL.pm line 131 > > But if I just change the last line into: > > my $sess = CGI::Session->new("driver:MySQL;id:MD5", $q, {Handle => $dbh}); > > ... the script works with no errors, even though I have just changed > $Presa::H::session into my $session). > > Do you have any idea why?
I have also tried to change that last line to start with: our $session = ... but it gives again that error. It seems that I can use it only with "my" and not with "our" or with the full package definition. Thank you for any idea and suggestion for making that var to be accessible from other packages. Teddy -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>