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:
ENV problem in perl

 



axsharma
New User

Mar 5, 2004, 3:40 AM

Post #1 of 4 (579 views)
ENV problem in perl Can't Post

Hi,

I am here with a typical problem. We use perl to run some jobs on the UNIX server. These jobs are triggered from mainframe. On the server we have a process called tracker which spools for trigger request from m/f and when it gets one it executes the perl script called runjob.pl.

Now the problem is we are using UDB here and UDB needs a setup scripts be run which sets up the ENV variables required to run, as a result we need to run this shell script from within our perl program. I tried `. setup.sh` in perl but it doesn't set the env for my program, and it fails saying DB2INSTANCE not set. Is there a way I can run this script from my program and get it to recognise the variable set?

Any help will be highly appreciated.

Regards

Arvind


davorg
Thaumaturge / Moderator

Mar 5, 2004, 9:23 AM

Post #2 of 4 (578 views)
Re: [axsharma] ENV problem in perl [In reply to] Can't Post

You'll need to run the script that sets up the environment _before_ starting the Perl program.


Code
. setup.sh 
runjob.pl


--
Dave Cross, Perl Hacker, Trainer and Writer
http://www.dave.org.uk/
Get more help at Perl Monks


axsharma
New User

Mar 5, 2004, 9:28 AM

Post #3 of 4 (577 views)
Re: [axsharma] ENV problem in perl [In reply to] Can't Post

Many thanks for your reply but unfortunately I don't have that option. I need to run the runjob.pl first.


davorg
Thaumaturge / Moderator

Mar 5, 2004, 9:35 AM

Post #4 of 4 (576 views)
Re: [axsharma] ENV problem in perl [In reply to] Can't Post

Then your best option is probably to parse the setup.sh file and set the %ENV values yourself.

--
Dave Cross, Perl Hacker, Trainer and Writer
http://www.dave.org.uk/
Get more help at Perl Monks

 
 


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

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