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: David Hajoglou <hojo at greenland dot i-tel dot com>
Subject: Re: passing $dbh around
Date: Jun 10 1999 11:04PM

This gave interesting results:

the output:

dbh is -1-
Can't call method "nsql" without a package or object reference at
/usr/lib/perl5
/site_perl/5.005/itel/h_test.pm line 14.
=================
the script:

use strict;
use itel::h_test;
use Sybase::DBlib;

my $dbh = Sybase::DBlib->dblogin('hojo','htmg4177','IRELAND',"$$");

&itel::h_test::test($dbh);
==========================

the module:

package itel::h_test;

#use strict;
use Sybase::DBlib;

dbmsghandle("Sybase::DBlib::nsql_message_handler");
dberrhandle("Sybase::DBlib::nsql_error_handler");

sub test {
        my $dbh = @_;
        print "\ndbh is -$dbh-\n";
        my $x = $dbh->nsql("select * from lkjsdf");
        print "\n$DB_ERROR---\n";
}