You can't pipe at both ends in perl - at least not without serious pain.
You may be able to do this by using IO::Pipe to set up a pair of pipes,
fork() and attaching the pipes to stdin/stdout of the subprocess, exec-ing
exim, and talking to the pipes in the parent process - you probably need
IO::Select to make sure you don't get yourself knotted.
The easy solution is more likely to be:-
open (CMD, "| exim -d0 -bh $ipaddr 2>&1 >/tmp/filespec");
print CMD "various SMTP bits"
close CMD;
open (CMDRES, "</tmp/filespec");
(read and process earlier command output)
This would be pretty easy to do in expect....
I don't know of a decent easily available perl expect module yet.
Nigel.
--
[ Nigel.Metheringham@??? - Systems Software Engineer ]
[ Tel : +44 113 207 6112 Fax : +44 113 234 6065 ]
[ Real life is but a pale imitation of a Dilbert strip ]
--
*** Exim information can be found at
http://www.exim.org/ ***