Steve Thomas wrote:
> I'm writing a wrapper in perl for our LDA (a customized version of tmail)
> which will process the mail through SA.
> 
> Everything's fine piping the message into SA - it comes back with headers
> added etc.
> 
> The problem is that I can't open a _bidirectional_ pipe to a program
> (spamc), as you can with a regular file.
> 
> Anyone know how to open a file/command (open FOO, "|foo"), write to it and
> then read back from it? It seems like something that would be needed fairly
> often, although I can't say that I've run across the need for it in the
> couple of years that I've been playing with perl..

The best developed and most cross platform capable module for this in 
Perl is IPC::Run. I know Barrie Slaymaker pretty well (I speak to him 
usually every day), so if you get stuck with it, give me a shout and I 
can get you some help.

IPC::Run allows you to basically feed a process with data as and when it 
can accept it. And you can do buffered reads on the data coming back out 
of it. It's a bit like IPC::Open2, but more like the mythical 
"IPC::Open3" (given that it allows you to also control STDERR).

Matt.



_______________________________________________________________

Don't miss the 2002 Sprint PCS Application Developer's Conference
August 25-28 in Las Vegas -- http://devcon.sprintpcs.com/adp/index.cfm

_______________________________________________
Spamassassin-talk mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/spamassassin-talk

Reply via email to