$trigger='OFF'; my $pid = fork(); if ($pid == 0) { #some process invoked on xterm if (process invoked on xterm gives a signal){ $trigger='ON'; } exit 0; } my $pid = fork(); if ($pid == 0) { #some other process on xterm if( $trigger eq 'ON') { #------->This has value OFF as declared globally. I want this to have value from previous process. What do I do? #do something exit 0; }