{ my $output_string = ''; local *STDOUT; tie *STDOUT, 'IO::Scalar', \$output_string; stdout_sub(); }