File Coverage

blib/lib/IO/TieCombine/Handle.pm
Criterion Covered Total %
statement 19 25 76.0
branch 3 4 75.0
condition n/a
subroutine 5 9 55.5
pod n/a
total 27 38 71.0


line stmt bran cond sub pod time code
1 1     1   6 use strict;
  1         2  
  1         428  
2 1     1   8 use warnings;
  1         2  
  1         55  
3             package IO::TieCombine::Handle;
4             # ABSTRACT: tied filehandles for IO::TieCombine
5             $IO::TieCombine::Handle::VERSION = '1.004';
6 1     1   4 use Carp ();
  1         2  
  1         1063  
7              
8             sub TIEHANDLE {
9 2     2   4 my ($class, $arg) = @_;
10              
11 2         10 my $self = {
12             slot_name => $arg->{slot_name},
13             combined_ref => $arg->{combined_ref},
14             output_ref => $arg->{output_ref},
15             };
16              
17 2         10 return bless $self => $class;
18             }
19              
20             sub PRINT {
21 5     5   1791 my ($self, @output) = @_;
22              
23 5 50       31 my $joined = join((defined $, ? $, : q{}), @output)
    100          
24             . (defined $\ ? $\ : q{});
25              
26 5         8 ${ $self->{output_ref} } .= $joined;
  5         15  
27 5         9 ${ $self->{combined_ref} } .= $joined;
  5         13  
28              
29 5         45 return 1;
30             }
31              
32             sub PRINTF {
33 0     0     my $self = shift;
34 0           my $fmt = shift;
35 0           $self->PRINT(sprintf($fmt, @_));
36             }
37              
38 0     0     sub OPEN { return $_[0] }
39 0     0     sub BINMODE { return 1; }
40 0     0     sub FILENO { return 0 + $_[0] }
41              
42             1;
43              
44             __END__