| 1 | package Pod::Simple::TiedOutFH; | ||||||||||||||||||||||||||||
| 2 | 71 | ▶ | use strict; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 3 | 71 | ▶ | use warnings; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 4 | 71 | ▶ | use Symbol ('gensym'); | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 5 | 71 | ▶ | use Carp (); | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 6 | 71 | our $VERSION = '3.48'; | |||||||||||||||||||||||||||
| 7 | |||||||||||||||||||||||||||||
| 8 | #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | ||||||||||||||||||||||||||||
| 9 | |||||||||||||||||||||||||||||
| 10 | 893 | ▶ | sub handle_on { # some horrible frightening things are encapsulated in here | ||||||||||||||||||||||||||
|
Subroutine
handle_on: called CC=6 SCAR=18.8
Pod
undocumented
| |||||||||||||||||||||||||||||
| 11 | 893 | my $class = shift; | |||||||||||||||||||||||||||
| 12 | 893 | ▶ | $class = ref($class) || $class; | ||||||||||||||||||||||||||
|
Condition33%1/3
ref $class || $class
MC/DC0%0/2
ref $class || $class
ref $class
$class
Truth table33%1/3
A || B
A= ref $classB= $class
| |||||||||||||||||||||||||||||
| 13 | |||||||||||||||||||||||||||||
| 14 | 893 | ▶ | Carp::croak "Usage: ${class}->handle_on(\$somescalar)" unless @_; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 15 | |||||||||||||||||||||||||||||
| 16 | 893 | ▶ | my $x = (defined($_[0]) and ref($_[0])) | ||||||||||||||||||||||||||
|
Branch: 1 branch
Condition66%2/3
defined $_[0] and ref $_[0]
MC/DC50%1/2
defined $_[0] and ref $_[0]
defined $_[0]
ref $_[0]
Truth table66%2/3
A and B
A= defined $_[0]B= ref $_[0]
| |||||||||||||||||||||||||||||
| 17 | ? $_[0] | ||||||||||||||||||||||||||||
| 18 | : ( \( $_[0] ) )[0] | ||||||||||||||||||||||||||||
| 19 | ; | ||||||||||||||||||||||||||||
| 20 | 893 | ▶ | $$x = '' unless defined $$x; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 21 | |||||||||||||||||||||||||||||
| 22 | #Pod::Simple::DEBUG and print STDERR "New $class handle on $x = \"$$x\"\n"; | ||||||||||||||||||||||||||||
| 23 | |||||||||||||||||||||||||||||
| 24 | 893 | my $new = gensym(); | |||||||||||||||||||||||||||
| 25 | 893 | tie *$new, $class, $x; | |||||||||||||||||||||||||||
| 26 | 893 | return $new; | |||||||||||||||||||||||||||
| 27 | } | ||||||||||||||||||||||||||||
| 28 | |||||||||||||||||||||||||||||
| 29 | #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | ||||||||||||||||||||||||||||
| 30 | |||||||||||||||||||||||||||||
| 31 | 893 | ▶ | sub TIEHANDLE { # Ties to just a scalar ref | ||||||||||||||||||||||||||
|
Subroutine
TIEHANDLE: called CC=3 SCAR=12.5
| |||||||||||||||||||||||||||||
| 32 | 893 | my($class, $scalar_ref) = @_; | |||||||||||||||||||||||||||
| 33 | 893 | ▶ | $$scalar_ref = '' unless defined $$scalar_ref; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 34 | 893 | ▶ | return bless \$scalar_ref, ref($class) || $class; | ||||||||||||||||||||||||||
|
Condition33%1/3
ref $class || $class
MC/DC0%0/2
ref $class || $class
ref $class
$class
Truth table33%1/3
A || B
A= ref $classB= $class
| |||||||||||||||||||||||||||||
| 35 | } | ||||||||||||||||||||||||||||
| 36 | |||||||||||||||||||||||||||||
| 37 | 18188 | ▶ | sub PRINT { | ||||||||||||||||||||||||||
|
Subroutine
PRINT: called CC=2 SCAR=6.9
| |||||||||||||||||||||||||||||
| 38 | 18188 | my $it = shift; | |||||||||||||||||||||||||||
| 39 | 18188 | foreach my $x (@_) { $$$it .= $x } | |||||||||||||||||||||||||||
| 40 | |||||||||||||||||||||||||||||
| 41 | #Pod::Simple::DEBUG > 10 and print STDERR " appended to $$it = \"$$$it\"\n"; | ||||||||||||||||||||||||||||
| 42 | |||||||||||||||||||||||||||||
| 43 | 18188 | return 1; | |||||||||||||||||||||||||||
| 44 | } | ||||||||||||||||||||||||||||
| 45 | |||||||||||||||||||||||||||||
| 46 | 0 | ▶ | sub FETCH { | ||||||||||||||||||||||||||
|
Subroutine
FETCH: not called CC=1 SCAR=6.9
| |||||||||||||||||||||||||||||
| 47 | 0 | return ${$_[0]}; | |||||||||||||||||||||||||||
| 48 | } | ||||||||||||||||||||||||||||
| 49 | |||||||||||||||||||||||||||||
| 50 | 0 | ▶ | sub PRINTF { | ||||||||||||||||||||||||||
|
Subroutine
PRINTF: not called CC=1 SCAR=6.9
| |||||||||||||||||||||||||||||
| 51 | 0 | my $it = shift; | |||||||||||||||||||||||||||
| 52 | 0 | my $format = shift; | |||||||||||||||||||||||||||
| 53 | 0 | $$$it .= sprintf $format, @_; | |||||||||||||||||||||||||||
| 54 | 0 | return 1; | |||||||||||||||||||||||||||
| 55 | } | ||||||||||||||||||||||||||||
| 56 | |||||||||||||||||||||||||||||
| 57 | 0 | ▶ | sub FILENO { ${ $_[0] } + 100 } # just to produce SOME number | ||||||||||||||||||||||||||
|
Subroutine
FILENO: not called CC=1 SCAR=6.9
| |||||||||||||||||||||||||||||
| 58 | |||||||||||||||||||||||||||||
| 59 | 0 | ▶ | sub CLOSE { 1 } | ||||||||||||||||||||||||||
|
Subroutine
CLOSE: not called CC=1 SCAR=6.9
| |||||||||||||||||||||||||||||
| 60 | |||||||||||||||||||||||||||||
| 61 | #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | ||||||||||||||||||||||||||||
| 62 | 71 | 1; | |||||||||||||||||||||||||||
| 63 | __END__ | ||||||||||||||||||||||||||||