PEPPLER.ORG
Michael Peppler
Sybase Consulting
Menu
Home
Sybase on Linux
Install Guide for Sybase on Linux
General Sybase Resources
General Perl Resources
Freeware
Sybperl
Sybase::Simple
DBD::Sybase
BCP Tool
Bug Tracker
Mailing List Archive
Downloads Directory
FAQs
Sybase on Linux FAQ
Sybperl FAQ
Personal
Michael Peppler's resume

sybperl-l Archive

Up    Prev    Next    

From: bpollock at ResGen dot COM
Subject: Objects-in-objects Question
Date: Nov 24 1997 3:58PM

Hi-

I am trying to write a simple package to help expedite generating some 
reports.  I have some questions on accessing a Sybase::CTlib object that 
must be included in my SybSelect package.  I have included my constructor 
and one of the methods I am using for debugging.

Is there a better way to include the instantiation of the Sybase::CTlib 
object other than by referencing it through the hash?

Thanks for any advice,
Brian

##############################################################
# the constructor
##############################################################
sub new {
        my $proto = shift;
        my $class = ref($proto) || $proto;
        my $self = {};
        $self->{SRV} = shift;
        $self->{USR} = shift;
        $self->{PWD} = shift;
        $self->{SELECT} = undef;
        $self->{DBH} = Sybase::CTlib->ct_connect($self->{USR},
$self->{PWD}, $self->{SRV}); 
        bless ($self, $class);
        return $self;
}


sub querydb {
        my $self = shift;
        my $ref = $self->{DBH}->ct_sql($self->{SELECT});
        my $line="";
        foreach $line (@$ref) {
                print "@$line\n";
        }
}