in reply to Parsing Text from Object Header that prints to STDOUT

IO::Scalar might work for you -- this is a snippet from its man page:
use IO::Scalar; my $s; tie *STDOUT, 'IO::Scalar', \$s; print "line 1\nline 2\n", "line 3\n"; warn "String is now: $s\n"
Also take a look at this Q&A node for IO::Handle solutions: how do i redirect STDOUT, STDIN, or STDERR to a FILE?