in reply to passing env{} variable to child fails on linux,works on windows
Hello sdetweil,
Since you are testing for MS and treating the problem different for *nix and MS, you may not know about '/dev/shm' which most modern *nix have. If you do a 'df' you'll see if it's there. What this does is allow you to share information between different processes in *nix. It treats memory as a separate filesystem for you to 'open/read/write/close' in memory files without going to disk.
In my testing, I've found it to be 2 or more times faster than using disk, and it's 'cleaned-up' on re-boot.
I don't think the method you're using in *nix will work, since there is no relationship between the process created with 'open' and your process. Why it works in MS, someone else will have to explain. If you use 'fork', all variables are copied to the new process, so you can say:
and it will be available in the new 'fork'ed process.our $test_switch = 1; ## I recommend using 'our' over 'my' i +n this case ## It signals that it's something to b +e shared
Good Luck!
"Well done is better than well said." - Benjamin Franklin
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: passing env{} variable to child fails on linux,works on windows
by sdetweil (Sexton) on Jan 12, 2013 at 19:03 UTC | |
by dave_the_m (Monsignor) on Jan 12, 2013 at 19:37 UTC | |
by sdetweil (Sexton) on Jan 13, 2013 at 13:39 UTC | |
by andal (Hermit) on Jan 14, 2013 at 09:19 UTC | |
by thargas (Deacon) on Jan 14, 2013 at 13:49 UTC | |
by flexvault (Monsignor) on Jan 12, 2013 at 19:11 UTC |