line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package IO::Capture::Tie_STDx; |
2
|
|
|
|
|
|
|
|
3
|
|
|
|
|
|
|
sub TIEHANDLE { |
4
|
18
|
|
|
18
|
|
28
|
my $class = shift; |
5
|
18
|
|
|
|
|
141
|
bless [], $class; |
6
|
|
|
|
|
|
|
} |
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
sub PRINTF { |
9
|
9
|
|
|
9
|
|
46
|
my $self = shift; |
10
|
9
|
|
|
|
|
12
|
my $format = shift; |
11
|
9
|
|
|
|
|
56
|
$self->PRINT( sprintf( $format, @_ ) ); |
12
|
|
|
|
|
|
|
} |
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
sub PRINT { |
15
|
28
|
|
|
28
|
|
206
|
my $self = shift; |
16
|
28
|
|
|
|
|
110
|
push @$self, join '',@_; |
17
|
|
|
|
|
|
|
} |
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
sub READLINE { |
20
|
17
|
|
|
17
|
|
27
|
my $self = shift; |
21
|
17
|
50
|
|
|
|
704
|
return wantarray ? @$self : shift @$self; |
22
|
|
|
|
|
|
|
} |
23
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
sub CLOSE { |
25
|
0
|
|
|
0
|
|
|
my $self = shift; |
26
|
0
|
|
|
|
|
|
return close $self; |
27
|
|
|
|
|
|
|
} |
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
=head1 NAME |
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
IO::Capture::Tie_STDx; |
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
=head1 SYNOPSIS |
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
use IO::Capture::Tie_STDx; |
36
|
|
|
|
|
|
|
tie *STDOUT, "IO::Capture::Tie_STDx"; |
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
@$messages = ; |
39
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
untie *STDOUT; |
41
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
=head1 DESCRIPTION |
43
|
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
The module C is a small utility module for use by |
45
|
|
|
|
|
|
|
C derived modules. See L It is used to tie STDOUT or STDERR. |
46
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
=cut |
48
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
1; |