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: Todd Cooper <tcooper at individual dot com>
Subject: ct_callback from perl
Date: Mar 4 1998 10:59PM

I hope you can help :-)

I am having problems calling ct_callback from sybperl.  Do you have
any examples?  My problem may stem from the fact that I am calling
from my own library.  No way of passing the function seems to work.  I
looked at the test library in the distribution and it was not much
help.

The snippet of code I am using is:
	    $self->log("before setting callbacks retval=$retval error=$!");
	    $retval = $self->{'db_connection'}->ct_callback(CS_CLIENTMSG_CB, \&msg_cb);
	    $self->log("LOC1 retval=$retval error=$!");
	    $retval = $self->{'db_connection'}->ct_callback(CS_SERVERMSG_CB, "srv_cb");
	    $self->log("LOC2 retval=$retval error=$!");

I tried inline functions, defining the function in the perl module
outside the "object" library, perl function in the object library.

I get a variety of error messages back including just the usage
statement.

I am a novice with the perl function pointers.

How does the literal "srv_cb" actually work?  Does it look up a global
function with that name?

As in "Adventure", I am at Witt's End and I have read the magazine
(and RTFM)

-- 
Todd M. Cooper Todd.Cooper@NewsEdge.com todd@world.std.com
(was tcooper@individual.com todd@vmark.com)
NewsEdge Corporation
80 Blanchard Road
Burlington, MA 01803 Voice: 781-313-5634 FAX: 781-273-6088