=pod

=for advent_year 2008

=for advent_day 8

=for advent_title Running in a filtered wonderland

=for advent_author Jerrad Pierce

The jolly old elf enjoys milk and cookies, no spam and phish, so he recently
deployed a A<http://spamassassin.org|SpamAssassin> solution for his network.
However, he had a bunch of legacy systems that needed to be plugged into the
workflow as well, so he attempted to parse all incoming mail through a filter
that would pass messages through C<spamc> after the other message mangling
had taken place. All that business of daemons with forks and zombie children
sent shivers down his spine, so decided to work with pipes. The Friendly
Manual suggested <tt>IPC::Open2</tt> as the solution to his naive
C<open(SPAM, '|/bin/spamc|')>, and soon Santa discovered that classic toy
though they may be, blocks are no fun when it comes to interprocess
communication.

Had Santa searched CPAN he might have discovered M<IPC::Filter>, a module
intended to simplify the exchange of data between a script and sieving
subprocess. To do so, it wraps <tt>IPC::Open3</tt> up tightly along with
other goodies to yield such an amazingly simple interface that there's not
much left to be said:

=begin code

use IPC::Filter 'filter';

$b = filter($a, '/usr/bin/spamc');

=end code

