You could try Filter::Handle - thats what I do. Be careful though - it was broken in one part by a change in the underlying Perl IO in 5.8+, so some of the test cases for its 'make test' fail. But if you dont need those bits, its great.
+++++++++++++++++
#!/usr/bin/perl
use warnings;use strict;use brain;