The STDIN filehandle is shared between your two processes, and as you already noticed, whatever process comes first reads it all.
You could set a flag to specify, which process should read STDIN, or you could read all of STDIN and then call fork().
In reply to Re: Sharing STDIN after fork
by Corion
in thread Sharing STDIN after fork
by Bod
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |