#!/usr/bin/perl use strict; use warnings; use IO::String; my $io=tie( *STDOUT, 'IO::String' ); print "test\n"; print "LINE $_\n" for(0..9); my $txt=$io->string_ref(); warn $$txt;