# Copyright (C) 2006, The Perl Foundation.
# $Id: Capture.pm 17061 2007-02-19 19:30:30Z jkeenan $
package Capture;
use strict;
# Adapted from IO::Capture::Tie_STDx.
# Thanks as always to Mark Reynolds and Jon Morgan!

sub TIEHANDLE {
    my $class = shift;
    bless [], $class;
}

sub PRINT {
     my $self = shift;
     push @$self, join '',@_;
}

sub READLINE {
    my $self = shift;
    return wantarray ? @$self : shift @$self;
}

1;
