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: Monty Charlton <mcharlton at dtint dot com>
Subject: callback question
Date: Apr 14 2003 6:14PM

All,

I am using ct_callback in my code for trapping errors.  I call ct_callback 
like so:

ct_callback(CS_CLIENTMSG_CB, \&msg_cb);
ct_callback(CS_SERVERMSG_CB, \&srv_cb);

Then my msg_cb srv_cb subroutines log to a file.  The log file is currently 
hard-coded.

I need to have the log file defined at the command line or in a config file.  
I suppose I need to pass another parameter to each of these functions.  Short 
of defining a global variable to the log file path, is there a way to do 
this?

Something like:

sub msg_cb
{
my( $dbh, $number, $severity, $state, $line, $server, $proc, $msg, 
$userFileHandle ) = @_;
print $userFileHandle "error...";
return CS_SUCCEED;
}

Thanks.

Monty