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   5 use strict;
  1         2  
  1         22  
2 1     1   4 use warnings;
  1         1  
  1         38  
3             package IO::TieCombine::Handle;
4             # ABSTRACT: tied filehandles for IO::TieCombine
5             $IO::TieCombine::Handle::VERSION = '1.005';
6 1     1   4 use Carp ();
  1         2  
  1         256  
7              
8             sub TIEHANDLE {
9 2     2   3 my ($class, $arg) = @_;
10              
11             my $self = {
12             slot_name => $arg->{slot_name},
13             combined_ref => $arg->{combined_ref},
14             output_ref => $arg->{output_ref},
15 2         8 };
16              
17 2         7 return bless $self => $class;
18             }
19              
20             sub PRINT {
21 5     5   623 my ($self, @output) = @_;
22              
23 5 50       25 my $joined = join((defined $, ? $, : q{}), @output)
    100          
24             . (defined $\ ? $\ : q{});
25              
26 5         5 ${ $self->{output_ref} } .= $joined;
  5         13  
27 5         7 ${ $self->{combined_ref} } .= $joined;
  5         9  
28              
29 5         31 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__