|
||||
sybperl-l ArchiveUp Prev Next
From: Michael Peppler <mpeppler at peppler dot org> 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
|