perl-Test-Output (Utilities to test STDOUT and STDERR messages.)

Test::Output provides a simple interface for testing output sent to
STDOUT or STDERR. A number of different utilities are included to try
and be as flexible as possible to the tester.
