in reply to writing to a variable

You can always redirect STDOUT to a variable, i recently wrote some code over at 3Re: Tests for 'printing' code that used IO::Scalar to do just that. But, simply using sprintf instead might be a better solution.

jeffa

L-LL-L--L-LL-L--L-LL-L--
-R--R-RR-R--R-RR-R--R-RR
B--B--B--B--B--B--B--B--
H---H---H---H---H---H---
(the triplet paradiddle with high-hat)