my $DB = ref_to_db(); #at this point it's all good. i can call prepare like # $$DB->prepare(qq| etc etc etc.... #this would be fine too closenow(\$$DB); #now... # $DB is a reference to an open DB connection, # how do it reference to it in a hash, pass a reference # to the hash to a sub, then dereference to the DB ???!!! my %Booga - (DB => \$$DB ); closeplease(\%Booga); sub ref_to_db { my $DB = DBI->connect("DBI:mysql:dat...... etc etc return \$DB; } sub closenow { $_[0]->disconnect; } sub closeplease { my $Booga = $_[0]; #im at a loss here, is this way off? $$Booga{DB}->disconnect; }