Globals in Mason

Hello people,

I work on a connection to a second database. So I wrote following code to

my $handle = DBIx::SearchBuilder::Handle->new();

$handle->Connect( ‘Driver’ => ‘Pg’,
‘Database’ => ‘xy’,
‘User’ => ‘postgres’,
‘Password’ => ‘’) or die (“DB Verbindung kann nicht erstellt werden. $!”);

to try the connection

my $t = new Kunden($handle);
print("Kd-Nummer: ", $t->KdNr(), “\n”); looks like following:

use strict;
package Kunden;
use RT::Record;
use vars qw( @ISA, $handle );
@ISA= qw( RT::Record );

#use DBIx::SearchBuilder::Record;
#@ISA = (‘DBIx::SearchBuilder::Record’);

sub _Init {
print(“in INIT-Methode von\n”);
my $self = shift;
$handle = shift;
return ($self);

sub Create {
my $self = shift;
my %args = (
KdNr => ‘’,
#etc. other database fields
kdnr => $args{‘KdNr’},
etc. other database fields

Tell Record what the primary keys are

sub _PrimaryKeys {
my $self = shift;

sub _ClassAccessible {
{KdNr => {read => 1, write => 1, type => ‘varchar(12)’, default => ‘0’},
etc. other database fields
That works. But I need the $handle in other components and html-files too.
I added the Line: “PerlSetVar MasonAllowGlobals $handle” to the httpd.conf and
deleted the my in front of $handle in the autohandler, but no success. Maybe
I set this line at the wrong place. Where is the right place to set this?
Then I added:
allow_globals => [’$handle’] in front of
$handle = DBIx::SearchBuilder::Handle->new();
also no success.

How can I use the $handle in other files?
Does RT have a mechanism which disables globals?? So that I have to change my

Thanks for help!