| 1 | 6 | ▶ | use strict; use warnings; | ||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||
| 2 | package IO::All::STDIO; | ||||||||||||||||||||||||
| 3 | |||||||||||||||||||||||||
| 4 | 6 | ▶ | use IO::All -base; | ||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||
| 5 | 6 | ▶ | use IO::File; | ||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||
| 6 | |||||||||||||||||||||||||
| 7 | 6 | const type => 'stdio'; | |||||||||||||||||||||||
| 8 | |||||||||||||||||||||||||
| 9 | sub stdio { | ||||||||||||||||||||||||
| 10 | 7 | ▶ | my $self = shift; | ||||||||||||||||||||||
|
Subroutine
stdio: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||||||||||||||||
| 11 | 7 | bless $self, __PACKAGE__; | |||||||||||||||||||||||
| 12 | 7 | return $self->_init; | |||||||||||||||||||||||
| 13 | } | ||||||||||||||||||||||||
| 14 | |||||||||||||||||||||||||
| 15 | sub stdin { | ||||||||||||||||||||||||
| 16 | 1 | ▶ | my $self = shift; | ||||||||||||||||||||||
|
Subroutine
stdin: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||||||||||||||||
| 17 | 1 | $self->open('<'); | |||||||||||||||||||||||
| 18 | 1 | return $self; | |||||||||||||||||||||||
| 19 | } | ||||||||||||||||||||||||
| 20 | |||||||||||||||||||||||||
| 21 | sub stdout { | ||||||||||||||||||||||||
| 22 | 1 | ▶ | my $self = shift; | ||||||||||||||||||||||
|
Subroutine
stdout: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||||||||||||||||
| 23 | 1 | $self->open('>'); | |||||||||||||||||||||||
| 24 | 1 | return $self; | |||||||||||||||||||||||
| 25 | } | ||||||||||||||||||||||||
| 26 | |||||||||||||||||||||||||
| 27 | sub stderr { | ||||||||||||||||||||||||
| 28 | 2 | ▶ | my $self = shift; | ||||||||||||||||||||||
|
Subroutine
stderr: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||||||||||||||||
| 29 | 2 | $self->open_stderr; | |||||||||||||||||||||||
| 30 | 2 | return $self; | |||||||||||||||||||||||
| 31 | } | ||||||||||||||||||||||||
| 32 | |||||||||||||||||||||||||
| 33 | sub open { | ||||||||||||||||||||||||
| 34 | 9 | ▶ | my $self = shift; | ||||||||||||||||||||||
|
Subroutine
open: called CC=4 SCAR=14.0
Pod
documented
| |||||||||||||||||||||||||
| 35 | 9 | $self->is_open(1); | |||||||||||||||||||||||
| 36 | 9 | ▶ | my $mode = shift || $self->mode || '<'; | ||||||||||||||||||||||
|
Condition60%3/5
shift() || $self->mode || '<'
shift() or $self->mode
MC/DC0%0/2
shift() || $self->mode || '<'
shift()
$self->mode
Truth table66%2/3
A or B
A= shift()B= $self->mode
| |||||||||||||||||||||||||
| 37 | 9 | ▶ | my $fileno = $mode eq '>' | ||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||
| 38 | ? fileno(STDOUT) | ||||||||||||||||||||||||
| 39 | : fileno(STDIN); | ||||||||||||||||||||||||
| 40 | 9 | $self->io_handle(IO::File->new); | |||||||||||||||||||||||
| 41 | 9 | $self->io_handle->fdopen($fileno, $mode); | |||||||||||||||||||||||
| 42 | 9 | $self->_set_binmode; | |||||||||||||||||||||||
| 43 | } | ||||||||||||||||||||||||
| 44 | |||||||||||||||||||||||||
| 45 | sub open_stderr { | ||||||||||||||||||||||||
| 46 | 2 | ▶ | my $self = shift; | ||||||||||||||||||||||
|
Subroutine
open_stderr: called CC=2 SCAR=7.0
Pod
undocumented
| |||||||||||||||||||||||||
| 47 | 2 | $self->is_open(1); | |||||||||||||||||||||||
| 48 | 2 | $self->io_handle(IO::File->new); | |||||||||||||||||||||||
| 49 | 2 | ▶ | $self->io_handle->fdopen(fileno(STDERR), '>') ? $self : 0; | ||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||
| 50 | } | ||||||||||||||||||||||||
| 51 | |||||||||||||||||||||||||
| 52 | # XXX Add overload support | ||||||||||||||||||||||||
| 53 | |||||||||||||||||||||||||
| 54 | 6 | 1; | |||||||||||||||||||||||