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;

Prints:

Some text

DWIM is Perl's answer to Gödel