blib/lib/PLP/Tie/Print.pm

filter: Statementstmt 57.6% 15 / 26 Branchbran 50.0% 4 / 8 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 41.6% 5 / 12 Podpod n/a totaltotal 52.1% 24 / 46 CC 5 SCAR 13.4
CC
5
Cov
56%
PRINTF
12.0
PRINT
3.0
WRITE
2.0
CRAP 3.8
« blib/lib/PLP/Backend/CGI.pm ↑ Summary blib/lib/PLP/Tie/Headers.pm »
1 package PLP::Tie::Print;
2  
3 2 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 2 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
5  
6 2 our $VERSION = '1.00';
7  
8 =head1 PLP::Tie::Print
9  
10 Just prints to stdout, but sends headers if not sent before.
11  
12 tie *HANDLE, 'PLP::Tie::Print';
13  
14 This module is part of the PLP Internals and probably not of much use to others.
15  
16 =cut
17  
18 23 ▶sub TIEHANDLE { bless \my $dummy, $_[0] }
Subroutine TIEHANDLE: called CC=1 SCAR=0.0
19  
20 0 ▶sub WRITE { undef }
Subroutine WRITE: not called CC=1 SCAR=6.9
21  
22 35 ▶sub PRINT {
Subroutine PRINT: called CC=3 SCAR=11.0
23 35 shift;
24 35 ▶ return unless grep length, @_;
Branch: 1 branch
BranchTrueFalseTotal
unless grep length($_), @_ 12 23 35
25 23 ▶ PLP::sendheaders() unless $PLP::sentheaders;
Branch: 1 branch
BranchTrueFalseTotal
unless $PLP::sentheaders 22 1 23
26 23 print STDOUT @_;
27 23 select STDOUT;
28 }
29  
30 0 ▶sub PRINTF {
Subroutine PRINTF: not called CC=3 SCAR=24.8
31 0 shift;
32 0 ▶ return unless length $_[0];
Branch: 1 branch
BranchTrueFalseTotal
unless length $_[0] 0 0 0
33 0 ▶ PLP::sendheaders() unless $PLP::sentheaders;
Branch: 1 branch
BranchTrueFalseTotal
unless $PLP::sentheaders 0 0 0
34 0 printf STDOUT @_;
35 0 select STDOUT;
36 }
37  
38 0 ▶sub READ { undef }
Subroutine READ: not called CC=1 SCAR=6.9
39  
40 0 ▶sub READLINE { undef }
Subroutine READLINE: not called CC=1 SCAR=6.9
41  
42 0 ▶sub GETC { '%' }
Subroutine GETC: not called CC=1 SCAR=6.9
43  
44 0 ▶sub CLOSE { undef }
Subroutine CLOSE: not called CC=1 SCAR=6.9
45  
46 0 ▶sub UNTIE { undef }
Subroutine UNTIE: not called CC=1 SCAR=6.9
47  
48 21 ▶sub DESTROY { undef }
Subroutine DESTROY: called CC=1 SCAR=0.0
49  
50 2 1;
51  
« blib/lib/PLP/Backend/CGI.pm ↑ Summary blib/lib/PLP/Tie/Headers.pm »