in reply to Perl Test - Capture print statements
In WWW::Mechanize::Shell, I use IO::Catch, originally written by schwern to capture all output intended for STDOUT or STDERR into separate variables. See the test files for the usage of IO::Catch.