Hi all!
Im creating a class named DemoDB, the purpouse of this class its to give data.
For example, I create an object:
$object = new DemoDB;
And I want to retrieve data (the name of the leader), so
$object->get_leadername();
Ok, the questions its inside the class. I have this:
sub new {
my $this = shift; #Tomar el objeto de donde viene
my $clase = ref($this) || $this; #Tomar el nombre de la clase
my $dDB = {};
$dDB->{LINK} =
DBI->connect("DBI:mysql:$basedatos_nombre:$basedatos_servidor",
$basedatos_usuario,$basedatos_password);
bless($dDB, $clase);
return $dDB;
}
The big question, is it valid to save the 'link connection', inside
$dDB->{LINK}?, so I can use it in other methods.
Thanks!!!
Pablo
--
Pablo Fischer Sandoval ([EMAIL PROTECTED])
http://www.pablo.com.mx
http://www.debianmexico.org
GPG FingerTip: 3D49 4CB8 8951 F2CA 8131 AF7C D1B9 1FB9 6B11 810C
Firma URL: http://www.pablo.com.mx/firmagpg.txt
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]