perl -MIO::Scalar -le 'my $s; $SH = IO::Scalar->new(\$s); print $SH "foo"; print $s'