in reply to mutiple forks
You may also get bitten by the fact that PARENTWRITE is buffered. Don't expect communication between your two processes to be instantaneous. Use select(PARENTWRITE); $|=1; select(STDOUT); or the IO::Handle equivalent to change this behavior.print PARENTWRITE "1\n"; # perhaps something useful like $pid?
Note: Code samples are for conceptual use only and generally are not meant to be cut/pasted into a production application. Always 'use strict', have a thorough understanding of the code you use, and check the return values of functions and handle errors according to your needs. - Fastolfe
|
|---|