| 1 | # ABSTRACT: Construct data structure from Parser Events | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 2 | 48 | ▶ | use strict; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 3 | 48 | ▶ | use warnings; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 4 | package YAML::PP::Constructor; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 5 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 6 | 48 | our $VERSION = 'v0.43.0'; # VERSION | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 7 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 8 | 48 | ▶ | use YAML::PP; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 9 | 48 | ▶ | use YAML::PP::Common qw/ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 10 | PRESERVE_ORDER PRESERVE_SCALAR_STYLE PRESERVE_FLOW_STYLE PRESERVE_ALIAS | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 11 | 48 | /; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 12 | 48 | ▶ | use Scalar::Util qw/ reftype /; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 13 | 48 | ▶ | use Carp qw/ croak /; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 14 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 15 | 48 | ▶ | use constant DEBUG => ($ENV{YAML_PP_LOAD_DEBUG} or $ENV{YAML_PP_LOAD_TRACE}) ? 1 : 0; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=3 SCAR=12.5
Branch: 1 branch
Condition33%1/3
$ENV{"YAML_PP_LOAD_DEBUG"} or $ENV{"YAML_PP_LOAD_TRACE"}
MC/DC0%0/2
$ENV{"YAML_PP_LOAD_DEBUG"} or $ENV{"YAML_PP_LOAD_TRACE"}
$ENV{"YAML_PP_LOAD_DEBUG"}
$ENV{"YAML_PP_LOAD_TRACE"}
Truth table33%1/3
A or B
A= $ENV{"YAML_PP_LOAD_DEBUG"}B= $ENV{"YAML_PP_LOAD_TRACE"}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 16 | 48 | ▶ | use constant TRACE => $ENV{YAML_PP_LOAD_TRACE} ? 1 : 0; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=2 SCAR=7.1
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 17 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 18 | 48 | ▶ | use constant MAX_DEPTH => 2 ** 9; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 19 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 20 | 48 | my %cyclic_refs = qw/ allow 1 ignore 1 warn 1 fatal 1 /; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 21 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 22 | 766 | ▶ | sub new { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
new: called CC=8 SCAR=20.9
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 23 | 766 | my ($class, %args) = @_; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 24 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 25 | 766 | my $default_yaml_version = delete $args{default_yaml_version}; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 26 | 766 | my $duplicate_keys = delete $args{duplicate_keys}; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 27 | 766 | ▶ | unless (defined $duplicate_keys) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 28 | 453 | $duplicate_keys = 0; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 29 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 30 | 766 | my $require_footer = delete $args{require_footer}; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 31 | 766 | ▶ | my $max_depth = delete $args{max_depth} || MAX_DEPTH; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition100%2/2
delete $args{'max_depth'} || 512.0
MC/DC100%1/1
delete $args{'max_depth'} || 512.0
delete $args{'max_depth'}
Truth table100%2/2
A
A= delete $args{'max_depth'}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 32 | 766 | ▶ | my $preserve = delete $args{preserve} || 0; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition100%2/2
delete $args{'preserve'} || 0
MC/DC100%1/1
delete $args{'preserve'} || 0
delete $args{'preserve'}
Truth table100%2/2
A
A= delete $args{'preserve'}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 33 | 766 | ▶ | if ($preserve == 1) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 34 | 1 | $preserve = PRESERVE_ORDER | PRESERVE_SCALAR_STYLE | PRESERVE_FLOW_STYLE | PRESERVE_ALIAS; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 35 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 36 | 766 | ▶ | my $cyclic_refs = delete $args{cyclic_refs} || 'fatal'; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition50%1/2
delete $args{'cyclic_refs'} || 'fatal'
MC/DC0%0/1
delete $args{'cyclic_refs'} || 'fatal'
delete $args{'cyclic_refs'}
Truth table50%1/2
A
A= delete $args{'cyclic_refs'}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 37 | die "Invalid value for cyclic_refs: $cyclic_refs" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 38 | 766 | ▶ | unless $cyclic_refs{ $cyclic_refs }; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 39 | 765 | my $schemas = delete $args{schemas}; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 40 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 41 | 765 | ▶ | if (keys %args) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 42 | 0 | die "Unexpected arguments: " . join ', ', sort keys %args; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 43 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 44 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 45 | 765 | my $self = bless { | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 46 | default_yaml_version => $default_yaml_version, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 47 | schemas => $schemas, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 48 | cyclic_refs => $cyclic_refs, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 49 | preserve => $preserve, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 50 | duplicate_keys => $duplicate_keys, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 51 | require_footer => $require_footer, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 52 | max_depth => $max_depth, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 53 | }, $class; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 54 | 765 | $self->init; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 55 | 765 | return $self; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 56 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 57 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 58 | 9 | ▶ | sub clone { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
clone: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 59 | 9 | my ($self) = @_; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 60 | my $clone = { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 61 | schemas => $self->{schemas}, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 62 | schema => $self->{schema}, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 63 | default_yaml_version => $self->{default_yaml_version}, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 64 | cyclic_refs => $self->cyclic_refs, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 65 | preserve => $self->{preserve}, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 66 | max_depth => $self->{max_depth}, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 67 | 9 | }; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 68 | 9 | return bless $clone, ref $self; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 69 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 70 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 71 | 2976 | ▶ | sub init { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
init: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 72 | 2976 | my ($self) = @_; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 73 | 2976 | $self->set_docs([]); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 74 | 2976 | $self->set_stack([]); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 75 | 2976 | $self->set_anchors({}); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 76 | 2976 | $self->set_yaml_version($self->default_yaml_version); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 77 | 2976 | $self->set_schema($self->schemas->{ $self->yaml_version } ); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 78 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 79 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 80 | 4473 | ▶ | sub docs { return $_[0]->{docs} } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
docs: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 81 | 39884 | ▶ | sub stack { return $_[0]->{stack} } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
stack: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 82 | 588 | ▶ | sub anchors { return $_[0]->{anchors} } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
anchors: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 83 | 2976 | ▶ | sub set_docs { $_[0]->{docs} = $_[1] } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
set_docs: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 84 | 5270 | ▶ | sub set_stack { $_[0]->{stack} = $_[1] } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
set_stack: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 85 | 5270 | ▶ | sub set_anchors { $_[0]->{anchors} = $_[1] } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
set_anchors: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 86 | 3010 | ▶ | sub schemas { return $_[0]->{schemas} } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
schemas: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 87 | 29449 | ▶ | sub schema { return $_[0]->{schema} } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
schema: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 88 | 3010 | ▶ | sub set_schema { $_[0]->{schema} = $_[1] } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
set_schema: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 89 | 18 | ▶ | sub cyclic_refs { return $_[0]->{cyclic_refs} } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
cyclic_refs: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 90 | 0 | ▶ | sub set_cyclic_refs { $_[0]->{cyclic_refs} = $_[1] } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
set_cyclic_refs: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 91 | 2976 | ▶ | sub yaml_version { return $_[0]->{yaml_version} } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
yaml_version: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 92 | 3010 | ▶ | sub set_yaml_version { $_[0]->{yaml_version} = $_[1] } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
set_yaml_version: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 93 | 3000 | ▶ | sub default_yaml_version { return $_[0]->{default_yaml_version} } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
default_yaml_version: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 94 | 1629 | ▶ | sub preserve_order { return $_[0]->{preserve} & PRESERVE_ORDER } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
preserve_order: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 95 | 26629 | ▶ | sub preserve_scalar_style { return $_[0]->{preserve} & PRESERVE_SCALAR_STYLE } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
preserve_scalar_style: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 96 | 2857 | ▶ | sub preserve_flow_style { return $_[0]->{preserve} & PRESERVE_FLOW_STYLE } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
preserve_flow_style: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 97 | 29480 | ▶ | sub preserve_alias { return $_[0]->{preserve} & PRESERVE_ALIAS } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
preserve_alias: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 98 | 5 | ▶ | sub duplicate_keys { return $_[0]->{duplicate_keys} } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
duplicate_keys: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 99 | 2137 | ▶ | sub require_footer { return $_[0]->{require_footer} } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
require_footer: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 100 | 2865 | ▶ | sub max_depth { return $_[0]->{max_depth} } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
max_depth: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 101 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 102 | 2329 | ▶ | sub document_start_event { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
document_start_event: called CC=3 SCAR=11.0
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 103 | 2329 | my ($self, $event) = @_; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 104 | 2329 | my $stack = $self->stack; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 105 | 2329 | ▶ | if ($event->{version_directive}) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 106 | 34 | my $version = $event->{version_directive}; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 107 | 34 | $version = "$version->{major}.$version->{minor}"; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 108 | 34 | ▶ | if ($self->{schemas}->{ $version }) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 109 | 22 | $self->set_yaml_version($version); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 110 | 22 | $self->set_schema($self->schemas->{ $version }); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 111 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 112 | else { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 113 | 12 | $self->set_yaml_version($self->default_yaml_version); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 114 | 12 | $self->set_schema($self->schemas->{ $self->default_yaml_version }); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 115 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 116 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 117 | 2329 | my $ref = []; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 118 | 2329 | push @$stack, { type => 'document', ref => $ref, data => $ref, event => $event }; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 119 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 120 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 121 | 2297 | ▶ | sub document_end_event { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
document_end_event: called CC=5 SCAR=16.2
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 122 | 2297 | my ($self, $event) = @_; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 123 | 2297 | my $stack = $self->stack; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 124 | 2297 | my $last = pop @$stack; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 125 | 2297 | ▶ | $last->{type} eq 'document' or die "Expected mapping, but got $last->{type}"; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 126 | 2297 | ▶ | if (@$stack) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 127 | 0 | die "Got unexpected end of document"; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 128 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 129 | 2297 | my $docs = $self->docs; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 130 | 2297 | ▶ | if ($event->{implicit} and $self->require_footer) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition100%3/3
$event->{"implicit"} and $self->require_footer
MC/DC100%2/2
$event->{"implicit"} and $self->require_footer
$event->{"implicit"}
$self->require_footer
Truth table100%3/3
A and B
A= $event->{"implicit"}B= $self->require_footer
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 131 | 3 | die sprintf "load: Document (%d) did not end with '...' (require_footer=1)", 1 + scalar @$docs; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 132 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 133 | 2294 | push @$docs, $last->{ref}->[0]; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 134 | 2294 | $self->set_anchors({}); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 135 | 2294 | $self->set_stack([]); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 136 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 137 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 138 | 2861 | ▶ | sub _check_depth { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
_check_depth: called CC=3 SCAR=11.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 139 | 2861 | my ($self) = @_; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 140 | 2861 | my $stack = $self->stack; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 141 | 2861 | my $c = @$stack; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 142 | 2861 | ▶ | if ($c > ($self->max_depth || MAX_DEPTH)){ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition50%1/2
$self->max_depth || 512.0
MC/DC0%0/1
$self->max_depth || 512.0
$self->max_depth
Truth table50%1/2
A
A= $self->max_depth
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 143 | 4 | croak sprintf 'Depth of nesting exceeds maximum %s', $self->max_depth; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 144 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 145 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 146 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 147 | 1631 | ▶ | sub mapping_start_event { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
mapping_start_event: called CC=9 SCAR=22.0
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 148 | 1631 | my ($self, $event) = @_; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 149 | 1631 | my ($data, $on_data) = $self->schema->create_mapping($self, $event); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 150 | 1631 | my $ref = { | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 151 | type => 'mapping', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 152 | ref => [], | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 153 | data => \$data, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 154 | event => $event, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 155 | on_data => $on_data, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 156 | }; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 157 | 1631 | $self->_check_depth; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 158 | 1629 | my $stack = $self->stack; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 159 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 160 | 1629 | my $preserve_order = $self->preserve_order; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 161 | 1629 | my $preserve_style = $self->preserve_flow_style; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 162 | 1629 | my $preserve_alias = $self->preserve_alias; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 163 | 1629 | ▶ | if (($preserve_order or $preserve_style or $preserve_alias) and not tied(%$data)) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition88%8/9
$preserve_order || $preserve_style || $preserve_alias and not tied %$data
$preserve_order or $preserve_style or $preserve_alias
$preserve_order or $preserve_style
MC/DC75%3/4
$preserve_order || $preserve_style || $preserve_alias and not tied %$data
$preserve_order
$preserve_style
$preserve_alias
not tied %$data
Truth table57%4/7
A or B or C and not(D)
A= $preserve_orderB= $preserve_styleC= $preserve_aliasD= not tied %$data
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 164 | 24 | tie %$data, 'YAML::PP::Preserve::Hash', %$data; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 165 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 166 | 1629 | ▶ | if ($preserve_style) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 167 | 15 | my $t = tied %$data; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 168 | 15 | $t->{style} = $event->{style}; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 169 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 170 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 171 | 1629 | push @$stack, $ref; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 172 | 1629 | ▶ | if (defined(my $anchor = $event->{anchor})) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 173 | 77 | ▶ | if ($preserve_alias) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 174 | 6 | my $t = tied %$data; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 175 | 6 | ▶ | unless (exists $self->anchors->{ $anchor }) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 176 | # Repeated anchors cannot be preserved | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 177 | 5 | $t->{alias} = $anchor; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 178 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 179 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 180 | 77 | $self->anchors->{ $anchor } = { data => $ref->{data} }; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 181 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 182 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 183 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 184 | 1607 | ▶ | sub mapping_end_event { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
mapping_end_event: called CC=16 SCAR=27.7
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 185 | 1607 | my ($self, $event) = @_; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 186 | 1607 | my $stack = $self->stack; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 187 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 188 | 1607 | my $last = pop @$stack; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 189 | 1607 | my ($ref, $data) = @{ $last }{qw/ ref data /}; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 190 | 1607 | ▶ | $last->{type} eq 'mapping' or die "Expected mapping, but got $last->{type}"; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 191 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 192 | 1607 | my @merge_keys; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 193 | my @ref; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 194 | 1607 | ▶ | for (my $i = 0; $i < @$ref; $i += 2) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 195 | 12136 | my $key = $ref->[ $i ]; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 196 | 12136 | ▶ | if (ref $key eq 'YAML::PP::Type::MergeKey') { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 197 | 6 | my $merge = $ref->[ $i + 1 ]; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 198 | 6 | ▶ | if ((reftype($merge) || '') eq 'HASH') { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 2 branches
Condition100%2/2
builtin::reftype($merge) || ''
MC/DC100%1/1
builtin::reftype($merge) || ''
builtin::reftype($merge)
Truth table100%2/2
A
A= builtin::reftype($merge)
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 199 | 1 | push @merge_keys, $merge; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 200 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 201 | ▶ | elsif ((reftype($merge) || '') eq 'ARRAY') { | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition100%2/2
builtin::reftype($merge) || ''
MC/DC100%1/1
builtin::reftype($merge) || ''
builtin::reftype($merge)
Truth table100%2/2
A
A= builtin::reftype($merge)
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 202 | 4 | for my $item (@$merge) { | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 203 | 7 | ▶ | if ((reftype($item) || '') eq 'HASH') { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition100%2/2
builtin::reftype($item) || ''
MC/DC100%1/1
builtin::reftype($item) || ''
builtin::reftype($item)
Truth table100%2/2
A
A= builtin::reftype($item)
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 204 | 5 | push @merge_keys, $item; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 205 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 206 | else { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 207 | 2 | die "Expected hash for merge key"; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 208 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 209 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 210 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 211 | else { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 212 | 1 | die "Expected hash or array for merge key"; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 213 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 214 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 215 | else { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 216 | 12130 | push @ref, $key, $ref->[ $i + 1 ]; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 217 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 218 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 219 | 1604 | for my $merge (@merge_keys) { | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 220 | 6 | for my $key (keys %$merge) { | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 221 | 9 | ▶ | unless (exists $$data->{ $key }) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 222 | 8 | $$data->{ $key } = $merge->{ $key }; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 223 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 224 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 225 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 226 | 1534 | ▶ | my $on_data = $last->{on_data} || sub { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
__ANON__: called CC=6 SCAR=17.9
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 227 | 1534 | my ($self, $hash, $items) = @_; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 228 | 1534 | my %seen; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 229 | 1534 | ▶ | for (my $i = 0; $i < @$items; $i += 2) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 230 | 12010 | my ($key, $value) = @$items[ $i, $i + 1 ]; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 231 | 12010 | ▶ | $key = '' unless defined $key; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 232 | 12010 | ▶ | if (ref $key) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 233 | 71 | $key = $self->stringify_complex($key); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 234 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 235 | 12010 | ▶ | if ($seen{ $key }++ and not $self->duplicate_keys) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition100%3/3
$seen{$key}++ and not $self->duplicate_keys
MC/DC100%2/2
$seen{$key}++ and not $self->duplicate_keys
$seen{$key}++
not $self->duplicate_keys
Truth table100%3/3
A and not(B)
A= $seen{$key}++B= not $self->duplicate_keys
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 236 | 2 | croak "Duplicate key '$key'"; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 237 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 238 | 12008 | $$hash->{ $key } = $value; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 239 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 240 | 1604 | ▶ | }; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition66%2/3
$last->{'on_data'} || sub {
my($self, $hash, $items) = @_;
my %seen;
for (my $i = 0; $i < @$items; $i += 2) {
my($key, $value) = @$items[$i, $i + 1];
$key = '' unless defined $key;
if (ref $key) {
$key = $self->stringify_complex($key);
};
if ($seen{$key}++ and not $self->duplicate_keys) {
croak("Duplicate key '${key}'");
};
$$hash->{$key} = $value;
};
}
MC/DC0%0/2
$last->{'on_data'} || sub {
my($self, $hash, $items) = @_;
my %seen;
for (my $i = 0; $i < @$items; $i += 2) {
my($key, $value) = @$items[$i, $i + 1];
$key = '' unless defined $key;
if (ref $key) {
$key = $self->stringify_complex($key);
};
if ($seen{$key}++ and not $self->duplicate_keys) {
croak("Duplicate key '${key}'");
};
$$hash->{$key} = $value;
};
}
$last->{'on_data'}
sub {
my($self, $hash, $items) = @_;
my %seen;
for (my $i = 0; $i < @$items; $i += 2) {
my($key, $value) = @$items[$i, $i + 1];
$key = '' unless defined $key;
if (ref $key) {
$key = $self->stringify_complex($key);
};
if ($seen{$key}++ and not $self->duplicate_keys) {
croak("Duplicate key '${key}'");
};
$$hash->{$key} = $value;
};
}
Truth table66%2/3
A || B
A= $last->{'on_data'}B= sub {
my($self, $hash, $items) = @_;
my %seen;
for (my $i = 0; $i < @$items; $i += 2) {
my($key, $value) = @$items[$i, $i + 1];
$key = '' unless defined $key;
if (ref $key) {
$key = $self->stringify_complex($key);
};
if ($seen{$key}++ and not $self->duplicate_keys) {
croak("Duplicate key '${key}'");
};
$$hash->{$key} = $value;
};
}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 241 | 1604 | $on_data->($self, $data, \@ref); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 242 | 1592 | push @{ $stack->[-1]->{ref} }, $$data; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 243 | 1592 | ▶ | if (defined(my $anchor = $last->{event}->{anchor})) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 244 | 73 | $self->anchors->{ $anchor }->{finished} = 1; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 245 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 246 | 1592 | return; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 247 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 248 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 249 | 1230 | ▶ | sub sequence_start_event { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
sequence_start_event: called CC=7 SCAR=19.5
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 250 | 1230 | my ($self, $event) = @_; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 251 | 1230 | my ($data, $on_data) = $self->schema->create_sequence($self, $event); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 252 | 1230 | my $ref = { | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 253 | type => 'sequence', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 254 | ref => [], | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 255 | data => \$data, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 256 | event => $event, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 257 | on_data => $on_data, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 258 | }; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 259 | 1230 | my $stack = $self->stack; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 260 | 1230 | $self->_check_depth; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 261 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 262 | 1228 | my $preserve_style = $self->preserve_flow_style; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 263 | 1228 | my $preserve_alias = $self->preserve_alias; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 264 | 1228 | ▶ | if ($preserve_style or $preserve_alias and not tied(@$data)) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition83%5/6
$preserve_style or $preserve_alias and not tied @$data
$preserve_alias and not tied @$data
MC/DC66%2/3
$preserve_style or $preserve_alias and not tied @$data
$preserve_style
$preserve_alias
not tied @$data
Truth table75%3/4
A or B and not(C)
A= $preserve_styleB= $preserve_aliasC= not tied @$data
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 265 | 9 | tie @$data, 'YAML::PP::Preserve::Array', @$data; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 266 | 9 | my $t = tied @$data; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 267 | 9 | $t->{style} = $event->{style}; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 268 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 269 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 270 | 1228 | push @$stack, $ref; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 271 | 1228 | ▶ | if (defined(my $anchor = $event->{anchor})) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 272 | 30 | ▶ | if ($preserve_alias) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 273 | 6 | my $t = tied @$data; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 274 | 6 | ▶ | unless (exists $self->anchors->{ $anchor }) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 275 | # Repeated anchors cannot be preserved | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 276 | 5 | $t->{alias} = $anchor; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 277 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 278 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 279 | 30 | $self->anchors->{ $anchor } = { data => $ref->{data} }; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 280 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 281 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 282 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 283 | 1210 | ▶ | sub sequence_end_event { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
sequence_end_event: called CC=4 SCAR=13.9
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 284 | 1210 | my ($self, $event) = @_; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 285 | 1210 | my $stack = $self->stack; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 286 | 1210 | my $last = pop @$stack; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 287 | 1210 | ▶ | $last->{type} eq 'sequence' or die "Expected mapping, but got $last->{type}"; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 288 | 1210 | my ($ref, $data) = @{ $last }{qw/ ref data /}; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 289 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 290 | 1195 | ▶ | my $on_data = $last->{on_data} || sub { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
__ANON__: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 291 | 1195 | my ($self, $array, $items) = @_; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 292 | 1195 | push @$$array, @$items; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 293 | 1210 | ▶ | }; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition66%2/3
$last->{'on_data'} || sub {
my($self, $array, $items) = @_;
push @$$array, @$items;
}
MC/DC0%0/2
$last->{'on_data'} || sub {
my($self, $array, $items) = @_;
push @$$array, @$items;
}
$last->{'on_data'}
sub {
my($self, $array, $items) = @_;
push @$$array, @$items;
}
Truth table66%2/3
A || B
A= $last->{'on_data'}B= sub {
my($self, $array, $items) = @_;
push @$$array, @$items;
}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 294 | 1210 | $on_data->($self, $data, $ref); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 295 | 1210 | push @{ $stack->[-1]->{ref} }, $$data; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 296 | 1210 | ▶ | if (defined(my $anchor = $last->{event}->{anchor})) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 297 | 30 | my $test = $self->anchors->{ $anchor }; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 298 | 30 | $self->anchors->{ $anchor }->{finished} = 1; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 299 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 300 | 1210 | return; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 301 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 302 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 303 | 2211 | ▶ | sub stream_start_event {} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
stream_start_event: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 304 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 305 | 2176 | ▶ | sub stream_end_event {} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
stream_end_event: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 306 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 307 | 26588 | ▶ | sub scalar_event { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
scalar_event: called CC=9 SCAR=22.0
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 308 | 26588 | my ($self, $event) = @_; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 309 | 26588 | DEBUG and warn "CONTENT $event->{value} ($event->{style})\n"; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 310 | 26588 | my $value = $self->schema->load_scalar($self, $event); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 311 | 26579 | my $last = $self->stack->[-1]; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 312 | 26579 | my $preserve_alias = $self->preserve_alias; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 313 | 26579 | my $preserve_style = $self->preserve_scalar_style; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 314 | 26579 | ▶ | if (($preserve_style or $preserve_alias) and not ref $value) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition83%5/6
$preserve_style || $preserve_alias and not ref $value
$preserve_style or $preserve_alias
MC/DC66%2/3
$preserve_style || $preserve_alias and not ref $value
$preserve_style
$preserve_alias
not ref $value
Truth table60%3/5
A or B and not(C)
A= $preserve_styleB= $preserve_aliasC= not ref $value
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 315 | my %args = ( | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 316 | value => $value, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 317 | tag => $event->{tag}, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 318 | 83 | ); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 319 | 83 | ▶ | if ($preserve_style) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 320 | 17 | $args{style} = $event->{style}; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 321 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 322 | 83 | ▶ | if ($preserve_alias and defined $event->{anchor}) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition100%3/3
$preserve_alias and defined $event->{"anchor"}
MC/DC100%2/2
$preserve_alias and defined $event->{"anchor"}
$preserve_alias
defined $event->{"anchor"}
Truth table100%3/3
A and B
A= $preserve_aliasB= defined $event->{"anchor"}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 323 | 6 | my $anchor = $event->{anchor}; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 324 | 6 | ▶ | unless (exists $self->anchors->{ $anchor }) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 325 | # Repeated anchors cannot be preserved | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 326 | 5 | $args{alias} = $event->{anchor}; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 327 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 328 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 329 | 83 | $value = YAML::PP::Preserve::Scalar->new( %args ); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 330 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 331 | 26579 | ▶ | if (defined (my $name = $event->{anchor})) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 332 | 185 | $self->anchors->{ $name } = { data => \$value, finished => 1 }; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 333 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 334 | 26579 | push @{ $last->{ref} }, $value; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 335 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 336 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 337 | 145 | ▶ | sub alias_event { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
alias_event: called CC=7 SCAR=19.5
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 338 | 145 | my ($self, $event) = @_; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 339 | 145 | my $value; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 340 | 145 | my $name = $event->{value}; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 341 | 145 | ▶ | if (my $anchor = $self->anchors->{ $name }) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 342 | # We know this is a cyclic ref since the node hasn't | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 343 | # been constructed completely yet | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 344 | 144 | ▶ | unless ($anchor->{finished} ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 345 | 9 | my $cyclic_refs = $self->cyclic_refs; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 346 | 9 | ▶ | if ($cyclic_refs ne 'allow') { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 347 | 4 | ▶ | if ($cyclic_refs eq 'fatal') { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 348 | 2 | croak "Found cyclic ref for alias '$name'"; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 349 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 350 | 2 | ▶ | if ($cyclic_refs eq 'warn') { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 2 branches
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 351 | 1 | $anchor = { data => \undef }; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 352 | 1 | warn "Found cyclic ref for alias '$name'"; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 353 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 354 | elsif ($cyclic_refs eq 'ignore') { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 355 | 1 | $anchor = { data => \undef }; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 356 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 357 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 358 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 359 | 142 | $value = $anchor->{data}; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 360 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 361 | else { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 362 | 1 | croak "No anchor defined for alias '$name'"; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 363 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 364 | 142 | my $last = $self->stack->[-1]; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 365 | 142 | push @{ $last->{ref} }, $$value; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 366 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 367 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 368 | 75 | ▶ | sub stringify_complex { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
stringify_complex: called CC=4 SCAR=13.9
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 369 | 75 | my ($self, $data) = @_; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 370 | 75 | ▶ | return $data if ( | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition66%4/6
ref $data eq "YAML::PP::Preserve::Scalar" and $self->preserve_scalar_style || $self->preserve_alias
$self->preserve_scalar_style or $self->preserve_alias
MC/DC33%1/3
ref $data eq "YAML::PP::Preserve::Scalar" and $self->preserve_scalar_style || $self->preserve_alias
ref $data eq "YAML::PP::Preserve::Scalar"
$self->preserve_scalar_style
$self->preserve_alias
Truth table75%3/4
A and B or C
A= ref $data eq "YAML::PP::Preserve::Scalar"B= $self->preserve_scalar_styleC= $self->preserve_alias
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 371 | ref $data eq 'YAML::PP::Preserve::Scalar' | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 372 | and ($self->preserve_scalar_style or $self->preserve_alias) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 373 | ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 374 | 25 | require Data::Dumper; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 375 | 25 | local $Data::Dumper::Quotekeys = 0; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 376 | 25 | local $Data::Dumper::Terse = 1; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 377 | 25 | local $Data::Dumper::Indent = 0; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 378 | 25 | local $Data::Dumper::Useqq = 0; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 379 | 25 | local $Data::Dumper::Sortkeys = 1; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 380 | 25 | my $string = Data::Dumper->Dump([$data], ['data']); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 381 | 25 | $string =~ s/^\$data = //; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 382 | 25 | return $string; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 383 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 384 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 385 | 48 | 1; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 386 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 387 | __END__ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||