i have to find out which child returned by checking the Environment variable i manipulated in the child
So why not use wait or waitpid? It depends on how you launch the child processes, but you should be able to pick up the exit code from the child, which has a range of 0-255, usually in $?. See perlvar.