NAME
IO::Capture::ErrorMessages
- Capture output from STDERR
and warn()
SYNOPSYS
use IO::Capture::Stderr;
my $stderr_capture = IO::Capture::ErrorMessages->new();
$stderr_capture->start();
print STDERR "Test Line One\n";
print STDERR "Test Line Two\n";
print STDERR "Test Line Three\n";
warn "Test line Four\n";
$stderr_capture->stop();
$line = $capture->read;
print "$line"; # prints "Test Line One"
$line = $capture->read;
print "$line"; # prints "Test Line Two"
$capture->line_pointer(4);
$line = $capture->read;
print "$line"; # prints "Test Line Four"
$current_line_position = $capture->line_pointer;
DESCRIPTION
The module IO::Capture::Stderr
, is derived from the abstract class in IO::Capture
. IO::Capture It captures all output sent to STDERR, and installs a signal handler to capture the output sent via the warn()
function. (And friends - Such as carp()
) We primarily use it in module tests, where the test will cause some warning to be printed. To keep the output from cluttering up the nice neat row of 'ok's. ;-)
METHODS
AUTHORS
Mark Reynolds reynolds@sgi.com
Jon Morgan jmorgan@sgi.com
COPYRIGHT
Copyright (c) 2003, Mark Reynolds and Jon Morgan. All Rights Reserved. This module is free software. It may be used, redistributed and/or modified under the same terms as Perl itself.