in reply to Sticking IO::Handle on top of a scalar.

You could use IO::Scalar, or if your perl is 5.8+ then you could take advantage of the ability to open 'filehandles' to scalars e.g
my $str = ''; open my $fh, '>', \$str; print {$fh} 'this will end up in $str'; print "\$str contains: $str\n"; __output__ $str contains: this will end up in $str
For more info see. open and IO::Scalar.
HTH

_________
broquaint

update: reworded first sentence to make sense