| Test-Output documentation | Contained in the Test-Output distribution. |
Test::Output::Tie - module used by Test::Output to tie STDERR and STDOUT
You are probably more interested in reading Test::Output.
This module is used to tie STDOUT and STDERR in Test::Output.
The constructor for the class.
This method is called each time STDERR or STDOUT are printed to.
This method is called each time STDERR or STDOUT are printed to with printf.
This function is used to return all output printed to STDOUT or STDERR.
Currently maintained by brian d foy, bdfoy@cpan.org.
Shawn Sorichetti, <ssoriche@cpan.org>
This module is in Github:
http://github.com/briandfoy/test-output/tree/master
Currently maintained by brian d foy, bdfoy@cpan.org.
Copyright 2005-2008 Shawn Sorichetti, All Rights Reserved.
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
This code was taken from Test::Simple's TieOut.pm maintained Michael G Schwern. TieOut.pm was originally written by chromatic.
Thanks for the idea and use of the code.
| Test-Output documentation | Contained in the Test-Output distribution. |
package Test::Output::Tie; use vars qw($VERSION); $VERSION='1.01'; use strict; use warnings;
sub TIEHANDLE { my $class = shift; my $scalar = ''; my $obj = shift || \$scalar; bless( $obj, $class); }
sub PRINT { my $self = shift; $$self .= join(defined $, ? $, : '', @_); $$self .= defined $\ ? $\ : ''; # for say() }
sub PRINTF { my $self = shift; my $fmt = shift; $$self .= sprintf $fmt, @_; }
sub FILENO {}
sub BINMODE {}
sub read { my $self = shift; my $data = $$self; $$self = ''; return $data; }
1;