in reply to Confusion with two-way pipes

I tend to just read from STDIN and write to STDOUT then use shell commands, a shell script or a perl 'system' to run it.

That way you can do it to files and examine each stage during development, or do one huge pipeline, or even run it interactively.