in reply to Opening a named pipe to a daemon

Your sendmail example isn't what I'd call a named pipe.

The open(SENDMAIL, "|/usr/lib/sendmail...") is actually starting a new sendmail process, which will read an email from it's standard input, then write it to the mail queue and then exit. When you print to the SENDMAIL filehandle you are writing to the standard input of this new process.

The rest of the mail system (which might include a long-running daemon or might not) will at some point notice and handle this new mail item.

There might be a way to do what you want if you're more specific about what you want to do (which daemon, etc).