I'm not speaking from a personal knowledge of the Perl source code, but I have always been under the assumption that open calls with leading or trailing pipes do a fork/exec to start the subprocess.
If the exec fails (e.g., can't find the command) then the open returns a failure (in the parent process). If the exec succeeds, then the open returns success (in the parent process) and your program can start reading or writing to the sub-process.
You may get more clues about behavior you're seeing from the fork and exec documentation.
perldoc -f fork perldoc -f exec
(All of my posts should be implicitly prefaced with the fact that I only speak of Unix/Linux/Solaris/... In my world I tend to forget that there are environments like Windows/OS2/VMS...)
-- Eric Hammond
In reply to Re: When starting a process, at what point does "open()" return?
by esh
in thread When starting a process, at what point does "open()" return?
by tid
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |