Sometimes I encounter a script or program that wants to
print directly to STDOUT (like Parse::ePerl), but I want it in a scalar variable.
In those cases, I use this StringBuffer module to make a
filehandle that is tied to a scalar.
my $stdout = tie(*STDOUT,'StringBuffer');
print STDOUT 'this will magically get put in $stdout';