Capture/Tie_STDx.pm

filter: Statementstmt 83.3% 10 / 12 Branchbran 50.0% 1 / 2 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 80.0% 4 / 5 Podpod n/a totaltotal 78.9% 15 / 19 CC 2 SCAR 4.2
CC
2
Cov
79%
READLINE
2.1
CLOSE
2.0
TIEHANDLE
1.0
CRAP 1.5
« Capture/Stdout.pm ↑ Summary
1 package IO::Capture::Tie_STDx;
2  
3 18 ▶sub TIEHANDLE {
Subroutine TIEHANDLE: called CC=1 SCAR=0.0
4 18 my $class = shift;
5 18 bless [], $class;
6 }
7  
8 9 ▶sub PRINTF {
Subroutine PRINTF: called CC=1 SCAR=0.0
9 9 my $self = shift;
10 9 my $format = shift;
11 9 $self->PRINT( sprintf( $format, @_ ) );
12 }
13  
14 28 ▶sub PRINT {
Subroutine PRINT: called CC=1 SCAR=0.0
15 28 my $self = shift;
16 28 push @$self, join '',@_;
17 }
18  
19 17 ▶sub READLINE {
Subroutine READLINE: called CC=2 SCAR=7.2
20 17 my $self = shift;
21 17 ▶ return wantarray ? @$self : shift @$self;
Branch: 1 branch
BranchTrueFalseTotal
wantarray ? : 17 0 17
22 }
23  
24 0 ▶sub CLOSE {
Subroutine CLOSE: not called CC=1 SCAR=6.9
25 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 = <STDOUT>;
39  
40 untie *STDOUT;
41  
42 =head1 DESCRIPTION
43  
44 The module C<IO::Capture::Tie_STDx> is a small utility module for use by
45 C<IO::Capture> derived modules. See L<IO::Capture::Overview> It is used to tie STDOUT or STDERR.
46  
47 =cut
48  
49 11 1;
« Capture/Stdout.pm ↑ Summary