in reply to Writing to a file handle not attached to a file?
Something like this:
use strict; use warnings; my $buffer; open my $OUT, '>', \$buffer; print $OUT 'Some text'; close $OUT; print $buffer; [download]
Prints:
Some text [download]