blib/lib/Mason/TieHandle.pm untested

filter: Statementstmt 0.0% 0 / 15 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 0.0% 0 / 5 Podpod 0.0% 0 / 3 totaltotal 0.0% 0 / 23 SCAR 6.9
CC
1
Cov
0%
TIEHANDLE
2.0
PRINT
2.0
PRINTF
2.0
CRAP 2.0
1 package Mason::TieHandle;
2 $Mason::TieHandle::VERSION = '2.23';
3 use strict;
4 use warnings;
5  
6 sub TIEHANDLE {
7 my $class = shift;
8  
9 return bless {}, $class;
10 }
11  
12 sub PRINT {
13 my $self = shift;
14  
15 # TODO - why do we need to select STDOUT here?
16 my $old = select STDOUT;
17 $Mason::Request::current_request->print(@_);
18 select $old;
19 }
20  
21 sub PRINTF {
22 my $self = shift;
23  
24 # apparently sprintf(@_) won't work, it needs to be a scalar
25 # followed by a list
26 $self->PRINT( sprintf( shift, @_ ) );
27 }
28  
29 1;