http://www.perlmonks.org?node_id=284487


in reply to Re: When starting a process, at what point does "open()" return?
in thread When starting a process, at what point does "open()" return?

On UNIX systems, open("...|") ... returns after calling fork().

If this is true, how does open return an error if the program is not found, not executable, or has a bad shabang spec?

perl -e 'open F, "nosuchprogram |" or die "open: $!\n"; print "don +e\n";'
outputs:
open: No such file or directory

I had assumed that this was because it was only returning after the exec() but I'll admit this seems to take a bit more inter-process communication.

-- Eric Hammond