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: Michael Peppler <mpeppler at peppler dot org>
Subject: basic sybperl/cgi question
Date: Jun 3 1999 2:21PM

Sheree Hemphill writes:
 > I am new to both SybPerl and CGI, so my apologies in advance.  I was able to
 > make a successful connection to my using SybPerl CTlib with the following
 > syntax:
 > 
 > use Sybase::CTlib;
 > $dbh = new Sybase::CTlib 'loginid', 'password', 'dbservername';
 > $dbh->ct_sql("use dbname");
 > 
 > I did this in a perl program run from a prompt (unix platform).
 > 
 > However, when I copy these same lines into a perl cgi program, I get an
 > error message in return (the cgi form displayed properly prior to my adding
 > the above 3 lines, now it won't display at all).  Here is the exact code:

I would bet that the problem is in the SYBASE environment variable
isn't set correctly.

You can set this environment variable globally, in the httpd.conf - the 
exact syntax depends on your http server, for apache it's
	SetEnv SYBASE /usr/local/sybase

or you can set the environment variable in your script:

 > #!/usr/local/bin/perl

BEGIN {
    $ENV{SYBASE} = '/usr/local/sybase';   # put the correct path here!!!
}

 > 
 > use CGI qw/:standard/;
 > 
 > use Sybase::CTlib;

etc...


This should work a lot better.

Michael
-- 
Michael Peppler         -||-  Data Migrations Inc.
mpeppler@peppler.org    -||-  http://www.mbay.net/~mpeppler
Int. Sybase User Group  -||-  http://www.isug.com
Sybase on Linux mailing list: ase-linux-list@isug.com