Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
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."

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://932595]
help
Chatterbox?
[erix]: the neighbours (a nat.hist. museum) have a narwhal skull with *2* tusks
[erix]: ( also: UniCorn Throne )
[zentara]: erix I hope both tusks pointed in the same direction :-)
LanX "♪..♫ Last night a DJ killed my wife ♪..♫ "
zentara...oO 1 more reason I prefer Perl to Python is I can't believe how long Python takes to compile, and you can't disable the myriad of tests

How do I use this? | Other CB clients
Other Users?
Others imbibing at the Monastery: (10)
As of 2017-03-30 16:43 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Should Pluto Get Its Planethood Back?



    Results (361 votes). Check out past polls.