in reply to Access value of a variable after exit 0 in fork
The simplest would be to return a small numeric value via the exit code of the sub-process, read that in the parent process, and translate that in you main code to set $trigger to
"ON".
The problem you currently have is that $trigger in the child process is in a different memory space, and modifying that in the child has no effect on the parent's instance of $trigger.
"By three methods we may learn wisdom: First, by reflection, which is noblest; Second, by imitation, which is easiest; and third by experience, which is the bitterest." -Confucius
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: Access value of a variable after exit 0 in fork
by Anonymous Monk on Dec 27, 2012 at 08:53 UTC | |
by Anonymous Monk on Dec 27, 2012 at 10:52 UTC |
In Section
Seekers of Perl Wisdom