Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

Re: source a file in Linux using perl script

by Fletch (Bishop)
on Nov 30, 2020 at 14:48 UTC ( [id://11124396]=note: print w/replies, xml ) Need Help??


in reply to source a file in Linux using perl script

Just a note as to why you're getting these other solutions: when you're using backticks or system or whatever to run your source command a completely new shell is starting up, running the commands in the source'd script and changing that new shell's environment, and then that shell exits and any modifications disappear. The *NIX process model doesn't allow a child process to modify its parent's environment (as is noted in perlfaq8, "I {changed directory, modified my environment} in a perl script. How come the change disappeared . . .?" )

The cake is a lie.
The cake is a lie.
The cake is a lie.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others meditating upon the Monastery: (6)
As of 2024-04-18 00:52 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found