| 1 | # Copyright (c) 2026 Philipp Schafft | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 2 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 3 | # licensed under Artistic License 2.0 (see LICENSE file) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 4 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 5 | # ABSTRACT: Work with Tag databases | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 6 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 7 | package Data::TagDB::Base; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 8 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 9 | 4 | ▶ | use v5.10; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 10 | 4 | ▶ | use strict; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 11 | 4 | ▶ | use warnings; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 12 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 13 | 4 | ▶ | use Carp; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 14 | 4 | ▶ | use List::Util qw(any); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 15 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 16 | 4 | our $VERSION = v0.16; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 17 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 18 | 4 | my %_plugin_attr_pkg_map = ( | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 19 | 'Data::TagDB' => 'db_attributes', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 20 | 'Data::TagDB::Tag' => 'tag_attributes', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 21 | 'Data::TagDB::Metadata' => 'metadata_attributes', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 22 | 'Data::TagDB::Relation' => 'relation_attributes', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 23 | ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 24 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 25 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 26 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 27 | #@returns Data::TagDB | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 28 | 0 | ▶ | sub db { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
db: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 29 | 0 | my ($self) = @_; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 30 | 0 | return $self->{db}; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 31 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 32 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 33 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 34 | 0 | ▶ | sub get { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
get: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 35 | 0 | my ($self, @args) = @_; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 36 | 0 | return $self->_run_plugin('get', @args); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 37 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 38 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 39 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 40 | 0 | ▶ | sub execute { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
execute: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 41 | 0 | my ($self, @args) = @_; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 42 | 0 | return $self->_run_plugin('execute', @args); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 43 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 44 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 45 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 46 | 0 | ▶ | sub clear_cache { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
clear_cache: not called CC=2 SCAR=17.9
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 47 | 0 | my ($self, @opts) = @_; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 48 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 49 | 0 | ▶ | croak 'Stray options passed' if scalar @opts; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 50 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 51 | 0 | delete $self->{attribute_cache}; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 52 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 53 | 0 | return $self; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 54 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 55 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 56 | # ---- Private helpers ---- | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 57 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 58 | 0 | ▶ | sub _run_plugin { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
_run_plugin: not called CC=34 SCAR=70.8
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 59 | 0 | my ($self, $op, $key, %opts) = @_; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 60 | 0 | ▶ | my __PACKAGE__ $db = $self->isa('Data::TagDB') ? $self : $self->db; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 61 | 0 | ▶ | my $value = ($self->{attribute_cache} //= {})->{$key}; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition0%0/2
$self->{"attribute_cache"} //= {}
MC/DC0%0/1
$self->{"attribute_cache"} //= {}
$self->{"attribute_cache"}
Truth table0%0/2
A
A= $self->{"attribute_cache"}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 62 | 0 | my $has_default = exists $opts{default}; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 63 | 0 | my $default = delete $opts{default}; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 64 | 0 | my $listas = delete $opts{listas}; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 65 | 0 | ▶ | my $list = delete($opts{list}) // defined($listas); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition0%0/2
delete $opts{"list"} // defined $listas
MC/DC0%0/1
delete $opts{"list"} // defined $listas
delete $opts{"list"}
Truth table0%0/2
A
A= delete $opts{"list"}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 66 | 0 | my $as = delete $opts{as}; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 67 | 0 | my $data; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 68 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 69 | 0 | ▶ | croak 'Stray options passed' if scalar keys %opts; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 70 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 71 | 0 | ▶ | if (!defined($value) || $op eq 'execute') { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
not defined $value or $op eq "execute"
MC/DC0%0/2
not defined $value or $op eq "execute"
not defined $value
$op eq "execute"
Truth table0%0/3
not(A) or B
A= not defined $valueB= $op eq "execute"
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 72 | 0 | my ($ns, $subkey) = $key =~ /^([^#]+)#(.+)\z/; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 73 | 0 | my $info = $db->_get_plugin_info($ns); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 74 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 75 | 0 | ▶ | croak 'No such plugin loaded' unless defined $info; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 76 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 77 | 0 | ▶ | $info = $info->{$_plugin_attr_pkg_map{ref($self)} // '<BAD_PACKAGE>'}{$subkey}; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition0%0/2
$_plugin_attr_pkg_map{ref $self} // "<BAD_PACKAGE>"
MC/DC0%0/1
$_plugin_attr_pkg_map{ref $self} // "<BAD_PACKAGE>"
$_plugin_attr_pkg_map{ref $self}
Truth table0%0/2
A
A= $_plugin_attr_pkg_map{ref $self}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 78 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 79 | 0 | ▶ | croak 'No such attribute' unless defined $info; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 80 | 0 | ▶ | croak 'Attribute not '.$op.'-able' unless defined $info->{$op}; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 81 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 82 | { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 83 | 0 | my ($v, %extra) = $info->{$op}->($self, $key); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 84 | 0 | ▶ | unless ($extra{no_value}) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 85 | 0 | ▶ | $v = [$v] unless ref($v) eq 'ARRAY'; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 86 | 0 | $extra{_data} = $v; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 87 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 88 | 0 | $value = \%extra; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 89 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 90 | 0 | ▶ | unless ($op eq 'execute' || $extra{no_cache}) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
$op eq "execute" or $extra{"no_cache"}
MC/DC0%0/2
$op eq "execute" or $extra{"no_cache"}
$op eq "execute"
$extra{"no_cache"}
Truth table0%0/3
A or B
A= $op eq "execute"B= $extra{"no_cache"}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 91 | # We cache the value. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 92 | 0 | my $cache_value = $value; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 93 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 94 | 0 | ▶ | unless ($extra{no_value}) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 95 | # To ensure we build no cyclic references first we check our rawtype. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 96 | 0 | my %found = map {ref($_) => undef} @{$v}; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 97 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 98 | 0 | ▶ | if (exists $found{'Data::TagDB::Tag'}) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 2 branches
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 99 | # We can handle Data::TagDB::Tag but only if it's the only one | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 100 | 0 | ▶ | if (scalar(keys %found) == 1) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 101 | 0 | $cache_value->{rawtype} = 'Data::TagDB::Tag'; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 102 | 0 | $cache_value = {%{$cache_value}, _data => [map {$_->dbid} @{$v}], _restore_tags => 1}; # build our own object | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 103 | } else { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 104 | # Sadly we need to refuse to cache | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 105 | 0 | $cache_value = undef; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 106 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 107 | 0 | ▶ | } elsif (any {/^Data::TagDB::/} keys %found) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
__ANON__: not called CC=1 SCAR=6.9
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 108 | 0 | $cache_value = undef; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 109 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 110 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 111 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 112 | 0 | ▶ | $self->{attribute_cache}{$key} = $cache_value if $cache_value; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 113 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 114 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 115 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 116 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 117 | 0 | $data = $value->{_data}; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 118 | 0 | ▶ | unless (defined $data) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 119 | 0 | ▶ | croak 'No such value' unless $has_default; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 120 | 0 | ▶ | return @{$default} if $list; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 121 | 0 | return $default; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 122 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 123 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 124 | 0 | ▶ | unless ($list) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 125 | 0 | ▶ | if (scalar(@{$data}) != 1) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 126 | 0 | croak 'Not a single-value'; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 127 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 128 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 129 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 130 | 0 | ▶ | if ($value->{_restore_tags}) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 131 | 0 | $data = [map {$db->tag_by_dbid($_)} @{$data}]; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 132 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 133 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 134 | 0 | ▶ | if (defined($as) && $as ne 'raw' && !(defined($value->{rawtype}) && $as eq $value->{rawtype})) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/9
defined $as and $as ne "raw" and not defined $value->{"rawtype"} && $as eq $value->{"rawtype"}
defined $as and $as ne "raw"
defined $value->{'rawtype'} && $as eq $value->{'rawtype'}
MC/DC0%0/4
defined $as and $as ne "raw" and not defined $value->{"rawtype"} && $as eq $value->{"rawtype"}
defined $as
$as ne "raw"
defined $value->{'rawtype'}
$as eq $value->{'rawtype'}
Truth table0%0/5
A and B and not(C && D)
A= defined $asB= $as ne "raw"C= defined $value->{'rawtype'}D= $as eq $value->{'rawtype'}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 135 | 0 | $data = [map {Data::Identifier::as($_, $as, db => $db, rawtype => $value->{rawtype})} @{$data}]; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 136 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 137 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 138 | 0 | ▶ | if ($list) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 139 | 0 | ▶ | if (defined($listas)) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 140 | 0 | ▶ | if ($listas eq 'Data::TagDB::Iterator') { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 2 branches
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 141 | 0 | require Data::TagDB::Iterator; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 142 | 0 | return Data::TagDB::Iterator->from_array($data, db => $db); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 143 | } elsif ($listas eq 'Data::TagDB::Cloudlet') { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 144 | 0 | require Data::TagDB::Cloudlet; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 145 | 0 | return Data::TagDB::Cloudlet->new(root => $data, db => $db); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 146 | } else { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 147 | ... | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 148 | 0 | } | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 149 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 150 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 151 | 0 | return @{$data}; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 152 | } else { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 153 | 0 | return $data->[0]; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 154 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 155 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 156 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 157 | 4 | 1; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 158 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 159 | __END__ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||