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: 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;