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: "David A dot Guerrieri" <guerrier at Reston dot UnisysGSG dot COM>
Subject: RE: How do I get the environment right for a web CGI script?
Date: Feb 20 1996 1:37PM

I guess I'll try statically linking it then because it sounds easier than figuring out how to pass STDIN through the driver script that executes the perl script.  Using a driver that sets the environment is exactly how I have been working around the problem so far, but it became a problem when I started trying to get form data from the web server.

Thanks,
Dave
----------
From: 	Michael Peppler[SMTP:mpeppler@itf.CH]
Sent: 	Tuesday, February 20, 1996 1:46 AM
To: 	SYBPERL-L@trln.lib.unc.edu
Subject: 	Re: How do I get the environment right for a web CGI script?

> 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
>