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: abrown at mmm dot com
Subject: $SYBASE not recognized
Date: Jul 23 2002 2:52PM

I'm not sure if this is better suited for the perl mailing list or the
Sybperl mailing list, but here goes:

I have Sybperl 2.14 installed on Linux.  I am writing a cgi script to
gather stats from various Sybase servers.  Since I cannot guarantee what
environment variables the web server will have set (nearly none, I assume)
I am trying to explicitly set $SYBASE in the .cgi script, something like


$ENV{"SYBASE_ASE"}="/ASE-12_5";  # Don't think this is necessary, but tried
it anyhow...
$SYBASE=$ENV{"SYBASE"};       # Don't think this is necessary, either...
$SYBASE_OCS=$ENV{"SYBASE_OCS"};       # same here

use Sybase::CTlib;

... etc etc etc ...

However, I still get the following error, as if $SYBASE is not set ($SYBASE
should be set to /opt/sybase):

--- begin error ---
The context allocation routine failed when it tried to load localization
One or more following problems may caused the failure

Your sybase home directory is /home/sybase. Check the environment variable
SYBASE if it is not the one you want!
Cannot access file /home/sybase/config/objectid.dat
Sybase::CTlib initialize: cs_ctx_alloc() failed at
/usr/lib/perl5/5.6.1/i386-linux/ line 225.
Compilation failed in require at ./testme.cgi line 10.
BEGIN failed--compilation aborted at ./testme.cgi line 10.
--- end error ---

If I set $SYBASE in bash before executing the script, it runs fine, but
that doesn't help me from a web server perspective.  Any ideas?