in reply to How do I redirect STDOUT to a string?
use IO::Scalar; $std_out = tie *STDOUT, 'IO::Scalar'; print "hello world"; # goes into $std_out scalar; [download]