How can I use write() into a string?

See the perlform manpage for an swrite function.