|
|
sybperl-l Archive
Up Prev Next
From: rhall at corpny dot fbc dot com (Roger Hall)
Subject: CTlib object.
Date: May 14 1998 9:26PM
Hi,
I hope I'm not doing anything too wrong but perhaps someone can help ?
I'm trying to create a perl object for my database connections. It all
works fine until I try to have my own object data. Do I have to define
my objects' data via ct_connect, which works, or should the code below
work ?
The line that I have problems with (see sample code) is ...
$this->{'something'} = "This line causes problems.";
Thanks in advance for any help/advice.
Roger.
==================== FILE: go.pl ====================
use myCTlib;
my $rog = myCTlib->new();
$rog->ct_sql("use a_dbcat001");
==================== FILE: myCTlib.pm ====================
package myCTlib;
use Sybase::CTlib;
@ISA = qw(Sybase::CTlib);
sub new {
my $class = shift;
my $this = $class->Sybase::CTlib::ct_connect ("user","password","server")
|| die "OUCH";
$this->{'something'} = "This line causes problems.";
$this;
}
1;
|