Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

Re^3: Source command in perl script

by Utilitarian (Vicar)
on Oct 20, 2011 at 09:32 UTC ( #932595=note: print w/ replies, xml ) Need Help??


in reply to Re^2: Source command in perl script
in thread Source command in perl script

A parent process cannot inherit from a process it spawns.

You can however set the environment within the Perl script and then the system call will inherit it or you could run the db2profile scipt prior to running the Perl script and then everything would inherit it.

Rewriting as Perl

$ENV{PATH}="$ENV{PATH}:/opt/db2/bin" ...
Or calling everything from a shell script...
#!/bin/sh . /home/db2inst1/sqllib/db2profile /home/db2instl/bin/stop_db.pl # Or whatever the script is called

print "Good ",qw(night morning afternoon evening)[(localtime)[2]/6]," fellow monks."


Comment on Re^3: Source command in perl script
Select or Download Code

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://932595]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others lurking in the Monastery: (7)
As of 2014-07-10 23:40 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    When choosing user names for websites, I prefer to use:








    Results (217 votes), past polls