in reply to Redirect STDOUT to a $variable

Maybe it is enough to use sprintf:

use strict; use warnings; my $x; $x = sprintf ("%s","this is stored in \$x"); $x .= sprintf ("%s","... and this too\n"); print $x;

citromatik

Update:Corrected sprintf syntax