Sorry, forgot to show the error:
System error
error: Error during compilation of /www/htdocs/mason/profile.mas:
Global symbol "$dbh" requires explicit package name at
/www/htdocs/mason/profile.mas line 22.
context: ...
18:
19: my $auth = new CGI::Session::Auth::DBI({
20: CGI => $cgi,
21: Session => $session,
22: DBHandle => $dbh,
23: UserTable => 'users'
24: });
25: print "Error\n" if ( not defined $auth );
26:
...
code stack: /usr/lib/perl5/site_perl/5.8.8/HTML/Mason/Interp.pm:445
/usr/lib/perl5/site_perl/5.8.8/HTML/Mason/Request.pm:1088
/usr/lib/perl5/site_perl/5.8.8/HTML/Mason/Request.pm:1002
/usr/lib/perl5/site_perl/5.8.8/HTML/Mason/Request.pm:1197
/www/htdocs/autohandler:21
/usr/lib/perl5/site_perl/5.8.8/HTML/Mason/Request.pm:907
/www/mason/obj/155763555/autohandler.obj:6
----- Original Message -----
From: "Adam" <[EMAIL PROTECTED]>
To: <[email protected]>
Sent: Wednesday, May 24, 2006 10:48 PM
Subject: [Mason] Setting up shared $dbh in autohandler not working.
I've starte my Mason site. I have an autohandler that calls the *.mas
components.
Right now I have two components that set up their own $dbh database
handle. I want the auto handler to do that for me.
So at the bottom of the autohandler I made:
<%once>
my $dbh; # declare but don't assign
</%once>
<%init>
$dbh = DBI->connect("DBI:PgPP:dbname=dbname","user","pass");
</%init>
The $dbh assignemnt in the "init" block is exactly as in my sub-components
and the $dbh assignemnt has been taken out of the sub-components.
From what I read, my site should still work with the components using the
$dbh set up in the autohandler.
Any idea what I'm doing wrong?
-------------------------------------------------------
All the advantages of Linux Managed Hosting--Without the Cost and Risk!
Fully trained technicians. The highest number of Red Hat certifications in
the hosting industry. Fanatical Support. Click to learn more
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=107521&bid=248729&dat=121642
_______________________________________________
Mason-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mason-users
-------------------------------------------------------
All the advantages of Linux Managed Hosting--Without the Cost and Risk!
Fully trained technicians. The highest number of Red Hat certifications in
the hosting industry. Fanatical Support. Click to learn more
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=107521&bid=248729&dat=121642
_______________________________________________
Mason-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mason-users