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 MBAY dot NET>
Subject: Problems with sybperl and web display
Date: Jul 27 1998 3:43PM

Johnson, Phil writes:
 > For some strange reason my sybperl scripts will no longer display results on
 > our apache web server.
 > I can display the output of other scripts, but not the sybperl scripts.
 > 
 > I haven't changed anything on our server and even rebooted it, but with no
 > avail.
 > 
 > I wrote the following simple script to help me debug this:
 > 
 > #!/usr/local/bin/perl -w
 > #
 > 
 > use Sybase::DBlib;
 > 
 > print"Before Connect\n";
 > 
 > $d = new Sybase::DBlib 'snm', 'snm', uc($ARGV[0]);
 > 
 > print"After Connect\n";
 > 
 > $ref = $d->sql("exec sgw_status rpc");
 > 
 > print"After execute\n";
 > 
 > 
 > foreach $line (@$ref) {
 >         print"@$line\n";
 > }
 > 
 > 
 > This works fine on the command line as user www, but when I run it through
 > netscape via CGI, I can only display the "Before Connect" and "After
 > Connect" messages.

Loook in the error logs. My bet is that the connect failed, and then
you try to call a method (sql()) via an undef value (which is what
'new' returns if the connection fails).

I would guess that someone's changed the value of the SYBASE
env. variable in the Apache config files. Try setting $ENV{SYBASE}
explicitly in your script.

Michael
-- 
Michael Peppler         -||-  Data Migrations Inc.
mpeppler@mbay.net       -||-  http://www.mbay.net/~mpeppler
Int. Sybase User Group  -||-  http://www.isug.com