Michael Peppler
Sybase Consulting
Sybase on Linux
Install Guide for Sybase on Linux
General Sybase Resources
General Perl Resources
BCP Tool
Bug Tracker
Mailing List Archive
Downloads Directory
Sybase on Linux FAQ
Sybperl FAQ
Michael Peppler's resume

sybperl-l Archive

Up    Prev    Next    

From: "Delegal, Darin" <ddelegal at citistreetonline dot com>
Subject: RE: Very Odd Problem
Date: Mar 29 2004 8:43PM

The "use" statement is already there in his example script (and in my code). I moved it to the top of the script and this allows the CS_SUCCEED to be called bare. If the "use" statement is physically below the call to CS_SUCCEED, perl won't let you call it without the "&". It's positional.

Either way, the CS_SUCCEED and other constants are defined as subroutines and not global variables.

Darin Delegal

-----Original Message-----
From: Rieder, Martin C (IM) []
Sent: Monday, March 29, 2004 3:36 PM
To: Delegal, Darin;
Subject: RE: Very Odd Problem

I use "CS_SUCCEED". I think you may need to add the following use

use Sybase::CTlib;


-----Original Message-----
From: []
On Behalf Of Delegal, Darin
Sent: Monday, March 29, 2004 3:30 PM
Subject: RE: Very Odd Problem

Maybe Michael can shed some light on this one. I do know that CS_SUCCEED
as well as most of the Sybase constants (?) are exported by and
are actually function calls, however, I haven't been able to call them
directly without the qualifier. CS_SUCCEED is indeed a subroutine and is
included in a "use subs" pragma in the I'm just not sure why
it isn't callable bare without "&" and () since it's included in the
list of standard exports also.

Darin Delegal

-----Original Message-----
From: []On
Behalf Of r huber
Sent: Monday, March 29, 2004 3:08 PM
Subject: RE: Very Odd Problem

Thanks. I did as you suggested and it worked great. 

I am somewhat new to perl and sybperl and do not
understand the use of the & in this context. I had
thought something like &CS_SUCCEED  would be a
subroutine call to CS_SUCCEED. Is CS_SUCCEED a
subroutine; I must admit I am somewhat confused.
-----Original Message-----
From: []On
Behalf Of Delegal, Darin
Sent: Monday, March 29, 2004 2:23 PM
Subject: RE: Very Odd Problem

According to the CTlib reference guide, a server
callback routine must retrun CS_SUCCEED. Client
message routines must return either CS_SUCCEED or
CS_FAIL. Since you're not specifying a return value
from the functions, perl is using the last result
value within the function (most likely the return
value from the print statements) which is confusing
the API.

If you simply add "return &CS_SUCCEED;" at the end of
each callback routine, things will work as intended.

Darin Delegal

Do you Yahoo!?
Yahoo! Finance Tax Center - File online. File on time. 
NOTICE: If received in error, please destroy and notify sender.  Sender does not waive confidentiality or privilege, and use is prohibited.