| 1 | # | ||||||||||||||||||||||||||||||||
| 2 | # $Id: Proc.pm,v 58d7ce835577 2023/03/25 10:34:10 gomor $ | ||||||||||||||||||||||||||||||||
| 3 | # | ||||||||||||||||||||||||||||||||
| 4 | package OPP::Proc; | ||||||||||||||||||||||||||||||||
| 5 | 2 | ▶ | use strict; | ||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||
| 6 | 2 | ▶ | use warnings; | ||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||
| 7 | |||||||||||||||||||||||||||||||||
| 8 | 2 | our $VERSION = '1.00'; | |||||||||||||||||||||||||||||||
| 9 | |||||||||||||||||||||||||||||||||
| 10 | 2 | ▶ | use base qw(OPP); | ||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||
| 11 | |||||||||||||||||||||||||||||||||
| 12 | 2 | our @AS = qw( | |||||||||||||||||||||||||||||||
| 13 | idx | ||||||||||||||||||||||||||||||||
| 14 | options | ||||||||||||||||||||||||||||||||
| 15 | nested | ||||||||||||||||||||||||||||||||
| 16 | state | ||||||||||||||||||||||||||||||||
| 17 | output | ||||||||||||||||||||||||||||||||
| 18 | ); | ||||||||||||||||||||||||||||||||
| 19 | 2 | __PACKAGE__->cgBuildIndices; | |||||||||||||||||||||||||||||||
| 20 | 2 | __PACKAGE__->cgBuildAccessorsScalar(\@AS); | |||||||||||||||||||||||||||||||
| 21 | |||||||||||||||||||||||||||||||||
| 22 | 2 | ▶ | use Carp; | ||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||
| 23 | 2 | ▶ | use Data::Dumper; | ||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||
| 24 | 2 | ▶ | use Storable; | ||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||
| 25 | |||||||||||||||||||||||||||||||||
| 26 | # | ||||||||||||||||||||||||||||||||
| 27 | # Always return values as ARRAY, undef when no value found: | ||||||||||||||||||||||||||||||||
| 28 | # | ||||||||||||||||||||||||||||||||
| 29 | sub value { | ||||||||||||||||||||||||||||||||
| 30 | 0 | ▶ | my $self = shift; | ||||||||||||||||||||||||||||||
|
Subroutine
value: not called CC=11 SCAR=48.8
Pod
undocumented
| |||||||||||||||||||||||||||||||||
| 31 | 0 | my ($flat, $field) = @_; | |||||||||||||||||||||||||||||||
| 32 | |||||||||||||||||||||||||||||||||
| 33 | 0 | ▶ | croak("value: need flat argument") unless defined($flat); | ||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||
| 34 | 0 | ▶ | croak("value: need field argument") unless defined($field); | ||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||
| 35 | |||||||||||||||||||||||||||||||||
| 36 | 0 | my @value = (); | |||||||||||||||||||||||||||||||
| 37 | |||||||||||||||||||||||||||||||||
| 38 | #delete $flat->{data}; | ||||||||||||||||||||||||||||||||
| 39 | #print "$field: ".Data::Dumper::Dumper($flat)."\n"; | ||||||||||||||||||||||||||||||||
| 40 | |||||||||||||||||||||||||||||||||
| 41 | # Handle nested fields: | ||||||||||||||||||||||||||||||||
| 42 | 0 | ▶ | if (my $split = $self->is_nested($field)) { | ||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||
| 43 | #print "*** is_nested ".$split->[0]." $field\n"; | ||||||||||||||||||||||||||||||||
| 44 | #print "*** is_nested ".$split->[1]." $field\n"; | ||||||||||||||||||||||||||||||||
| 45 | 0 | my $root = $split->[0]; | |||||||||||||||||||||||||||||||
| 46 | 0 | my $leaf = $split->[1]; | |||||||||||||||||||||||||||||||
| 47 | 0 | ▶ | if (defined($leaf)) { | ||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||
| 48 | 0 | for (@{$flat->{$root}}) { | |||||||||||||||||||||||||||||||
| 49 | 0 | ▶ | if (defined($_->{$leaf})) { | ||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||
| 50 | 0 | ▶ | my $ary = ref($_->{$leaf}) ? $_->{$leaf} : [ $_->{$leaf} ]; | ||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||
| 51 | 0 | push @value, @$ary; | |||||||||||||||||||||||||||||||
| 52 | } | ||||||||||||||||||||||||||||||||
| 53 | } | ||||||||||||||||||||||||||||||||
| 54 | } | ||||||||||||||||||||||||||||||||
| 55 | } | ||||||||||||||||||||||||||||||||
| 56 | # Handle standard fields: | ||||||||||||||||||||||||||||||||
| 57 | else { | ||||||||||||||||||||||||||||||||
| 58 | 0 | ▶ | if (defined($flat->{$field})) { | ||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||
| 59 | 0 | ▶ | my $ary = ref($flat->{$field}) eq 'ARRAY' ? $flat->{$field} : [ $flat->{$field} ]; | ||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||
| 60 | 0 | push @value, @$ary; | |||||||||||||||||||||||||||||||
| 61 | } | ||||||||||||||||||||||||||||||||
| 62 | } | ||||||||||||||||||||||||||||||||
| 63 | |||||||||||||||||||||||||||||||||
| 64 | #print "value: ".Data::Dumper::Dumper(\@value)."\n"; | ||||||||||||||||||||||||||||||||
| 65 | |||||||||||||||||||||||||||||||||
| 66 | 0 | ▶ | return @value ? \@value : undef; | ||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||
| 67 | } | ||||||||||||||||||||||||||||||||
| 68 | |||||||||||||||||||||||||||||||||
| 69 | sub fields { | ||||||||||||||||||||||||||||||||
| 70 | 0 | ▶ | my $self = shift; | ||||||||||||||||||||||||||||||
|
Subroutine
fields: not called CC=7 SCAR=40.3
Pod
undocumented
| |||||||||||||||||||||||||||||||||
| 71 | 0 | my ($flat) = @_; | |||||||||||||||||||||||||||||||
| 72 | |||||||||||||||||||||||||||||||||
| 73 | 0 | ▶ | croak("fields: need flat argument") unless defined($flat); | ||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||
| 74 | |||||||||||||||||||||||||||||||||
| 75 | 0 | my @fields = (); | |||||||||||||||||||||||||||||||
| 76 | |||||||||||||||||||||||||||||||||
| 77 | 0 | my $flat_fields = [ map { $_ } keys %$flat ]; | |||||||||||||||||||||||||||||||
| 78 | 0 | for my $field (@$flat_fields) { | |||||||||||||||||||||||||||||||
| 79 | 0 | ▶ | if ($self->is_nested($field)) { | ||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||
| 80 | 0 | ▶ | my $ary = ref($flat->{$field}) eq 'ARRAY' ? $flat->{$field} : [ $flat->{$field} ]; | ||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||
| 81 | 0 | for (@$ary) { | |||||||||||||||||||||||||||||||
| 82 | 0 | for my $leaf (keys %$_) { | |||||||||||||||||||||||||||||||
| 83 | 0 | push @fields, "$field.$leaf"; | |||||||||||||||||||||||||||||||
| 84 | } | ||||||||||||||||||||||||||||||||
| 85 | } | ||||||||||||||||||||||||||||||||
| 86 | } | ||||||||||||||||||||||||||||||||
| 87 | else { | ||||||||||||||||||||||||||||||||
| 88 | 0 | push @fields, $field; | |||||||||||||||||||||||||||||||
| 89 | } | ||||||||||||||||||||||||||||||||
| 90 | } | ||||||||||||||||||||||||||||||||
| 91 | |||||||||||||||||||||||||||||||||
| 92 | 0 | return \@fields; | |||||||||||||||||||||||||||||||
| 93 | } | ||||||||||||||||||||||||||||||||
| 94 | |||||||||||||||||||||||||||||||||
| 95 | sub values { | ||||||||||||||||||||||||||||||||
| 96 | 0 | ▶ | my $self = shift; | ||||||||||||||||||||||||||||||
|
Subroutine
values: not called CC=3 SCAR=24.8
Pod
undocumented
| |||||||||||||||||||||||||||||||||
| 97 | 0 | my ($flat) = @_; | |||||||||||||||||||||||||||||||
| 98 | |||||||||||||||||||||||||||||||||
| 99 | 0 | ▶ | croak("values: need flat argument") unless defined($flat); | ||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||
| 100 | |||||||||||||||||||||||||||||||||
| 101 | 0 | my @values = (); | |||||||||||||||||||||||||||||||
| 102 | 0 | my $fields = $self->fields($flat); | |||||||||||||||||||||||||||||||
| 103 | |||||||||||||||||||||||||||||||||
| 104 | 0 | for (@$fields) { | |||||||||||||||||||||||||||||||
| 105 | 0 | push @values, $flat->{$_}; | |||||||||||||||||||||||||||||||
| 106 | } | ||||||||||||||||||||||||||||||||
| 107 | |||||||||||||||||||||||||||||||||
| 108 | 0 | return \@values; | |||||||||||||||||||||||||||||||
| 109 | } | ||||||||||||||||||||||||||||||||
| 110 | |||||||||||||||||||||||||||||||||
| 111 | sub dumper { | ||||||||||||||||||||||||||||||||
| 112 | 0 | ▶ | my $self = shift; | ||||||||||||||||||||||||||||||
|
Subroutine
dumper: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||||||||||||||||||||||||
| 113 | 0 | my ($arg) = @_; | |||||||||||||||||||||||||||||||
| 114 | |||||||||||||||||||||||||||||||||
| 115 | 0 | return Data::Dumper::Dumper($arg)."\n"; | |||||||||||||||||||||||||||||||
| 116 | } | ||||||||||||||||||||||||||||||||
| 117 | |||||||||||||||||||||||||||||||||
| 118 | # | ||||||||||||||||||||||||||||||||
| 119 | # $self->delete($flat, "domain"); | ||||||||||||||||||||||||||||||||
| 120 | # $self->delete($flat, "app.http.component"); | ||||||||||||||||||||||||||||||||
| 121 | # $self->delete($flat, "app.http.component.product"); | ||||||||||||||||||||||||||||||||
| 122 | # | ||||||||||||||||||||||||||||||||
| 123 | sub delete { | ||||||||||||||||||||||||||||||||
| 124 | 0 | ▶ | my $self = shift; | ||||||||||||||||||||||||||||||
|
Subroutine
delete: not called CC=11 SCAR=48.8
Pod
undocumented
| |||||||||||||||||||||||||||||||||
| 125 | 0 | my ($flat, $field) = @_; | |||||||||||||||||||||||||||||||
| 126 | |||||||||||||||||||||||||||||||||
| 127 | 0 | ▶ | croak("delete: need flat argument") unless defined($flat); | ||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||
| 128 | 0 | ▶ | croak("delete: need field argument") unless defined($field); | ||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||
| 129 | |||||||||||||||||||||||||||||||||
| 130 | # Handle nested fields: | ||||||||||||||||||||||||||||||||
| 131 | 0 | ▶ | if (my $split = $self->is_nested($field)) { | ||||||||||||||||||||||||||||||
|
Branch: 2 branches
| |||||||||||||||||||||||||||||||||
| 132 | 0 | my $root = $split->[0]; | |||||||||||||||||||||||||||||||
| 133 | 0 | my $leaf = $split->[1]; | |||||||||||||||||||||||||||||||
| 134 | # Delete at the leaf level: | ||||||||||||||||||||||||||||||||
| 135 | 0 | ▶ | if ($root !~ m{^_} && defined($leaf)) { | ||||||||||||||||||||||||||||||
|
Branch: 2 branches
Condition0%0/3
not $root =~ /^_/ and defined $leaf
MC/DC0%0/2
not $root =~ /^_/ and defined $leaf
not $root =~ /^_/
defined $leaf
Truth table0%0/3
not(A) and B
A= not $root =~ /^_/B= defined $leaf
| |||||||||||||||||||||||||||||||||
| 136 | 0 | my @keep = (); | |||||||||||||||||||||||||||||||
| 137 | 0 | for my $this (@{$flat->{$root}}) { | |||||||||||||||||||||||||||||||
| 138 | 0 | delete $this->{$leaf}; | |||||||||||||||||||||||||||||||
| 139 | 0 | ▶ | push @keep, $this if keys %$this; # Keep the final object only when not empty | ||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||
| 140 | } | ||||||||||||||||||||||||||||||||
| 141 | # Keep the final array only when not empty | ||||||||||||||||||||||||||||||||
| 142 | 0 | ▶ | if (@keep > 0) { | ||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||
| 143 | 0 | $flat->{$root} = \@keep; | |||||||||||||||||||||||||||||||
| 144 | } | ||||||||||||||||||||||||||||||||
| 145 | # And when empty, completly remove the root field: | ||||||||||||||||||||||||||||||||
| 146 | else { | ||||||||||||||||||||||||||||||||
| 147 | 0 | delete $flat->{$root}; | |||||||||||||||||||||||||||||||
| 148 | } | ||||||||||||||||||||||||||||||||
| 149 | } | ||||||||||||||||||||||||||||||||
| 150 | # Or the complete root field when asked for: | ||||||||||||||||||||||||||||||||
| 151 | elsif ($root !~ m{^_}) { | ||||||||||||||||||||||||||||||||
| 152 | 0 | delete $flat->{$root}; | |||||||||||||||||||||||||||||||
| 153 | } | ||||||||||||||||||||||||||||||||
| 154 | } | ||||||||||||||||||||||||||||||||
| 155 | # Handle standard fields: | ||||||||||||||||||||||||||||||||
| 156 | elsif ($field !~ m{^_}) { | ||||||||||||||||||||||||||||||||
| 157 | 0 | delete $flat->{$field}; | |||||||||||||||||||||||||||||||
| 158 | } | ||||||||||||||||||||||||||||||||
| 159 | |||||||||||||||||||||||||||||||||
| 160 | 0 | return $flat; | |||||||||||||||||||||||||||||||
| 161 | } | ||||||||||||||||||||||||||||||||
| 162 | |||||||||||||||||||||||||||||||||
| 163 | # | ||||||||||||||||||||||||||||||||
| 164 | # $self->set($flat, "domain", "example.com"); | ||||||||||||||||||||||||||||||||
| 165 | # $self->set($flat, "app.http.component.product", "HTTP Server"); | ||||||||||||||||||||||||||||||||
| 166 | # | ||||||||||||||||||||||||||||||||
| 167 | sub set { | ||||||||||||||||||||||||||||||||
| 168 | 0 | ▶ | my $self = shift; | ||||||||||||||||||||||||||||||
|
Subroutine
set: not called CC=6 SCAR=37.4
Pod
undocumented
| |||||||||||||||||||||||||||||||||
| 169 | 0 | my ($flat, $field, $value) = @_; | |||||||||||||||||||||||||||||||
| 170 | |||||||||||||||||||||||||||||||||
| 171 | 0 | ▶ | croak("set: need flat argument") unless defined($flat); | ||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||
| 172 | 0 | ▶ | croak("set: need field argument") unless defined($field); | ||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||
| 173 | 0 | ▶ | croak("set: need value argument") unless defined($value); | ||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||
| 174 | |||||||||||||||||||||||||||||||||
| 175 | # Handle nested fields: | ||||||||||||||||||||||||||||||||
| 176 | 0 | ▶ | if (my $split = $self->is_nested($field)) { | ||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||
| 177 | 0 | my $root = $split->[0]; | |||||||||||||||||||||||||||||||
| 178 | 0 | my $leaf = $split->[1]; | |||||||||||||||||||||||||||||||
| 179 | # Delete at the leaf level: | ||||||||||||||||||||||||||||||||
| 180 | 0 | ▶ | if (defined($leaf)) { | ||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||
| 181 | 0 | $flat->{$root} = [ { $leaf => $value } ]; | |||||||||||||||||||||||||||||||
| 182 | } | ||||||||||||||||||||||||||||||||
| 183 | } | ||||||||||||||||||||||||||||||||
| 184 | # Handle standard fields: | ||||||||||||||||||||||||||||||||
| 185 | else { | ||||||||||||||||||||||||||||||||
| 186 | 0 | $flat->{$field} = $value; | |||||||||||||||||||||||||||||||
| 187 | } | ||||||||||||||||||||||||||||||||
| 188 | |||||||||||||||||||||||||||||||||
| 189 | 0 | return $flat; | |||||||||||||||||||||||||||||||
| 190 | } | ||||||||||||||||||||||||||||||||
| 191 | |||||||||||||||||||||||||||||||||
| 192 | # | ||||||||||||||||||||||||||||||||
| 193 | # Clone given doc so we can duplicate it and modify on a new one: | ||||||||||||||||||||||||||||||||
| 194 | # | ||||||||||||||||||||||||||||||||
| 195 | sub clone { | ||||||||||||||||||||||||||||||||
| 196 | 0 | ▶ | my $self = shift; | ||||||||||||||||||||||||||||||
|
Subroutine
clone: not called CC=2 SCAR=17.9
Pod
undocumented
| |||||||||||||||||||||||||||||||||
| 197 | 0 | my ($doc) = @_; | |||||||||||||||||||||||||||||||
| 198 | |||||||||||||||||||||||||||||||||
| 199 | 0 | ▶ | croak("clone: need doc argument") unless defined($doc); | ||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||
| 200 | |||||||||||||||||||||||||||||||||
| 201 | 0 | return Storable::dclone($doc); | |||||||||||||||||||||||||||||||
| 202 | } | ||||||||||||||||||||||||||||||||
| 203 | |||||||||||||||||||||||||||||||||
| 204 | # | ||||||||||||||||||||||||||||||||
| 205 | # Will return $arg parsed as usable arguments and also original $arg value: | ||||||||||||||||||||||||||||||||
| 206 | # | ||||||||||||||||||||||||||||||||
| 207 | sub parse { | ||||||||||||||||||||||||||||||||
| 208 | 0 | ▶ | my $self = shift; | ||||||||||||||||||||||||||||||
|
Subroutine
parse: not called CC=5 SCAR=34.0
Pod
undocumented
| |||||||||||||||||||||||||||||||||
| 209 | 0 | my ($args) = @_; | |||||||||||||||||||||||||||||||
| 210 | |||||||||||||||||||||||||||||||||
| 211 | 0 | my @a = Text::ParseWords::quotewords('\s+', 0, $args); | |||||||||||||||||||||||||||||||
| 212 | |||||||||||||||||||||||||||||||||
| 213 | # Also keep original value, for use with placeholders, for instance: | ||||||||||||||||||||||||||||||||
| 214 | 0 | my $parsed = { | |||||||||||||||||||||||||||||||
| 215 | args => $args, | ||||||||||||||||||||||||||||||||
| 216 | }; | ||||||||||||||||||||||||||||||||
| 217 | 0 | my $idx = 0; | |||||||||||||||||||||||||||||||
| 218 | 0 | for (@a) { | |||||||||||||||||||||||||||||||
| 219 | 0 | my ($k, $v) = split(/\s*[=:]\s*/, $_, 2); | |||||||||||||||||||||||||||||||
| 220 | 0 | ▶ | if (defined($k) && defined($v)) { | ||||||||||||||||||||||||||||||
|
Branch: 2 branches
Condition0%0/3
defined $k and defined $v
MC/DC0%0/2
defined $k and defined $v
defined $k
defined $v
Truth table0%0/3
A and B
A= defined $kB= defined $v
| |||||||||||||||||||||||||||||||||
| 221 | 0 | $parsed->{$k} = [ sort { $a cmp $b } split(/\s*,\s*/, $v) ]; | |||||||||||||||||||||||||||||||
| 222 | } | ||||||||||||||||||||||||||||||||
| 223 | elsif (defined($k)) { | ||||||||||||||||||||||||||||||||
| 224 | 0 | $parsed->{$idx++} = $k; | |||||||||||||||||||||||||||||||
| 225 | } | ||||||||||||||||||||||||||||||||
| 226 | } | ||||||||||||||||||||||||||||||||
| 227 | |||||||||||||||||||||||||||||||||
| 228 | 0 | return $parsed; | |||||||||||||||||||||||||||||||
| 229 | } | ||||||||||||||||||||||||||||||||
| 230 | |||||||||||||||||||||||||||||||||
| 231 | sub placeholder { | ||||||||||||||||||||||||||||||||
| 232 | 0 | ▶ | my $self = shift; | ||||||||||||||||||||||||||||||
|
Subroutine
placeholder: not called CC=4 SCAR=30.0
Pod
undocumented
| |||||||||||||||||||||||||||||||||
| 233 | 0 | my ($query, $flat) = @_; | |||||||||||||||||||||||||||||||
| 234 | |||||||||||||||||||||||||||||||||
| 235 | # Copy original to not modify it: | ||||||||||||||||||||||||||||||||
| 236 | 0 | my $copy = $query; | |||||||||||||||||||||||||||||||
| 237 | 0 | my (@holders) = $query =~ m{[\w\.]+\s*:\s*\$([\w\.]+)}g; | |||||||||||||||||||||||||||||||
| 238 | |||||||||||||||||||||||||||||||||
| 239 | # Update search clause with placeholder values | ||||||||||||||||||||||||||||||||
| 240 | 0 | my %searches = (); | |||||||||||||||||||||||||||||||
| 241 | 0 | for my $holder (@holders) { | |||||||||||||||||||||||||||||||
| 242 | 0 | my $values = $self->value($flat, $holder); | |||||||||||||||||||||||||||||||
| 243 | 0 | for my $value (@$values) { | |||||||||||||||||||||||||||||||
| 244 | 0 | ▶ | while ($copy =~ s{(\S+)\s*:\s*\$$holder}{$1:$value}) { } | ||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||
| 245 | 0 | $searches{$copy}++; # Make them unique | |||||||||||||||||||||||||||||||
| 246 | } | ||||||||||||||||||||||||||||||||
| 247 | } | ||||||||||||||||||||||||||||||||
| 248 | |||||||||||||||||||||||||||||||||
| 249 | 0 | return [ keys %searches ]; | |||||||||||||||||||||||||||||||
| 250 | } | ||||||||||||||||||||||||||||||||
| 251 | |||||||||||||||||||||||||||||||||
| 252 | 2 | 1; | |||||||||||||||||||||||||||||||
| 253 | |||||||||||||||||||||||||||||||||
| 254 | __END__ | ||||||||||||||||||||||||||||||||