Great! That worked. I had to modify my code to get rid of the <%shared> block where I declared my variable and add "PerlSetVar MasonAllowGlobals $dbh" to apache.conf

I have still two questions:

1. Can I use this "PerlSetVar MasonAllowGlobals $dbh" to set variables I only want shared per page request and then be destroyed? I want to set my $auth ( CGI::Session::Auth::DBI ) and $session ( CGI::Session::DBI )in the autohandler. Obviously I don't want anyone sharing $session or $auth. I though <%shared> would be perfect for those variables, but it looks like I can't even get $dbh to work in <%shared>.


2. When <%shared> was removed from my code and "PerlSetVar MasonAllowGlobals $dbh" was added to apache.conf, my code worked. How would you properly use <%shared> to set up the $dbh?


New working code:
<%init>
use DBI;

my $db = "db";
my $user = "user";
my $password = "password";

$dbh = DBI->connect("DBI:PgPP:dbname=$db","$user","$password");
</%init>



----- Original Message ----- From: "John Romkey" <[EMAIL PROTECTED]>
To: "Adam" <[EMAIL PROTECTED]>
Cc: <[email protected]>
Sent: Wednesday, May 24, 2006 11:05 PM
Subject: Re: [Mason] Setting up shared $dbh in autohandler not working.


Have you declared $dbh as a Mason global?

Under Apache you'd add

PerlSetVar MasonAllowGlobals $dbh

(or PerlAddVar, as your needs may be)

to the appropriate configuration file.
   - john romkey
   http://www.romkey.com/



-------------------------------------------------------
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

Reply via email to