Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

Re^5: passing env{} variable to child fails on linux,works on windows

by andal (Friar)
on Jan 14, 2013 at 09:19 UTC ( #1013173=note: print w/ replies, xml ) Need Help??


in reply to Re^4: passing env{} variable to child fails on linux,works on windows
in thread passing env{} variable to child fails on linux,works on windows

Here's the quote from perdloc threads

Currently, on all platforms except MSWin32, all system calls (e.g., us +ing system() or back-ticks) made from threads use the environment var +iable settings from the main thread. In other words, changes made to +%ENV in a thread will not be visible in system calls made by that thr +ead. To work around this, set environment variables as part of the system c +all. For example: my $msg = 'hello'; system("FOO=$msg; echo \$FOO"); # Outputs 'hello' to STDOUT On MSWin32, each thread maintains its own set of environment variables +.


Comment on Re^5: passing env{} variable to child fails on linux,works on windows
Select or Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others exploiting the Monastery: (6)
As of 2014-12-25 05:55 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?





    Results (159 votes), past polls