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: mpeppler at itf dot ch (Michael Peppler)
Subject: Re: How do I get the environment right for a web CGI script?
Date: Feb 20 1996 6:46AM

> From: "David A. Guerrieri" 
> 
> Sybperl needs the Open Client library to run so it needs LD_LIBRARY_PATH =
> set correctly.  How do I do this for a cgi script?  I guess I could =
> statically link Sybperl but will it still need $SYBASE set correctly in =
> order to find the interfaces file?

LD_LIBRARY_PATH needs to be set before the perl binary starts
executing. So you can either hack httpd to pass LD_LIBRARY_PATH on to
it's children, or execute a shell script that sets LD_LIBRARY_PATH and
then execs the real perl script:

#!/bin/sh
LD_LIBRARY_PATH=/usr/local/sybase10.0.2/lib
SYBASE=/usr/local/sybase10.0.2
export LD_LIBRARY_PATH SYBASE
exec script.pl

The SYBASE value can be set in the perl script, but you must make sure
that it is set *before* the DBlib or CTlib modules are loaded:

#!/usr/local/bin/perl

BEGIN {
   $ENV{SYBASE}='/usr/local/sybase10.0.2';
}

use Sybase::DBlib;

etc...

The BEGIN{} block ensures that it gets executed *before* anything else
gets done.

Michael


> 
> Dave
>