CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
INDEX
Search Posts SEARCH
POSTS
Who's Online WHO'S
ONLINE
Log in LOG
IN

Home: Perl Programming Help: Intermediate:
SYBASE ENV VARIABLE

 



ygjohn
Deleted

May 21, 2001, 8:30 PM

Post #1 of 4 (586 views)
SYBASE ENV VARIABLE Can't Post

HI all, this may be more of a aybase question. but you guys are my only hope.. :)
how do i setup the SYBASE ENV variable so that i dun have to do the following:
begin
{
$ENV{SYBASE} = 'my/sybase/path';
}
im runing apache on linux 2.4.4 with sybase ASE.
thanks




freddo
User

May 22, 2001, 9:31 AM

Post #2 of 4 (580 views)
Re: SYBASE ENV VARIABLE [In reply to] Can't Post

Hello John,

here's an extract from I {changed directory, modified my environment} in a perl script. How come the change disappeared when I exited the script? How do I get my changes to be visible? (which you can find with the following command at the prompt: perldoc -q ENV):

In the strictest sense, it can't be done--the script executes as a different process from the shell it was started from. Changes to a process are not reflected in its parent--only in any children created after the change. There is shell magic that may allow you to fake it by eval()ing the script's output in your shell; check out the comp.unix.questions FAQ for details.

here's the magic i use (you should only get one line of output to STDOUT), for bash(!):

Code
myperlfunc () 
{
MYVAR=/tmp/MYVAR$$-"$RANDOM"
myperlscript.pl "$@"> "$MYVAR"
SYBASE = "`cat $MYVAR`"
rm "$MYVAR"
unset MYVAR;
}

and you call it like:
myperlfunc param1 moreparams

i hope this helps
freddo

;---
Real programmers don't eat cache.


ygjohn
Deleted

May 22, 2001, 11:01 PM

Post #3 of 4 (574 views)
Re: SYBASE ENV VARIABLE [In reply to] Can't Post

Hi Freddo,

thanks for your post.
i did some research and had already found something and tot i might share it.

the ENV entry can be inserted into the /etc/profile
or if running apache server, in the httpd.conf file.

this way, the server is configured such that any developer coding for this server or any scripts running do not have to assign the sybase ENV entry manually since the entry should not change at all.
i think this should be the case.
in any case, here's how. (path may differ)
# in /etc/profile
export SYBASE=/opt/sybase

# using apache
SetEnv LD_LIBRARY_PATH /opt/sybase/lib
SetEnv SYBASE /opt/sybase
PassEnv LD_LIBRARY_PATH
PassEnv SYBASE

regards
john




freddo
User

May 23, 2001, 5:59 AM

Post #4 of 4 (572 views)
Re: SYBASE ENV VARIABLE [In reply to] Can't Post

That's good to share anyway, in fact i just saw i misunderstood the question a little, i though you had to modify and environment var from a script, and not setup a a server Tongue

freddo

;---
Real programmers don't eat cache.

 
 


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives