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; }
I don't know where this is breaking my cable, something about it is off- any comments.. The thing is giving me a nervous twitch in my left eye serioulsy.
In reply to pass reference, to a hash with a reference to an open db handle, to a sub - help by leocharre
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |