The Perl and Raku Conference 2025: Greenville, South Carolina - June 27-29 Learn more

NAME

IO::Catch - capture STDOUT and STDERR into global variables

AUTHOR

Max Maischein ( corion at cpan.org ) All code ripped from pod2test by M. Schwern

SYNOPSIS

# pre-5.8.0's warns aren't caught by a tied STDERR.
use vars qw($_STDOUT_, $_STDERR_);
tie *STDOUT, 'IO::Catch', '_STDOUT_' or die $!;
tie *STDERR, 'IO::Catch', '_STDERR_' or die $!;
# now you can access $main::_STDOUT_ and $_STDERR_
# to see the output.