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: "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) [mailto:Martin.Rieder@morganstanley.com]
Sent: Monday, March 29, 2004 3:36 PM
To: Delegal, Darin; sybperl-l@peppler.org
Subject: RE: Very Odd Problem


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

use Sybase::CTlib;

Regards,
Martin

-----Original Message-----
From: owner-sybperl-l@peppler.org [mailto:owner-sybperl-l@peppler.org]
On Behalf Of Delegal, Darin
Sent: Monday, March 29, 2004 3:30 PM
To: sybperl-l@peppler.org
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 CTlib.pm 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 CTlib.pm. 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: owner-sybperl-l@peppler.org [mailto:owner-sybperl-l@peppler.org]On
Behalf Of r huber
Sent: Monday, March 29, 2004 3:08 PM
To: sybperl-l@peppler.org
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.
Regards,
Robert
-----Original Message-----
From: owner-sybperl-l@peppler.org [mailto:owner-sybperl-l@peppler.org]On
Behalf Of Delegal, Darin
Sent: Monday, March 29, 2004 2:23 PM
To: sybperl-l@peppler.org
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.
http://taxes.yahoo.com/filing.html 
--------------------------------------------------------
 
NOTICE: If received in error, please destroy and notify sender.  Sender does not waive confidentiality or privilege, and use is prohibited.