| 1 | # | ||||||||||||
| 2 | # $Id: Fieldcount.pm,v cd68184c46bd 2023/03/23 09:32:23 gomor $ | ||||||||||||
| 3 | # | ||||||||||||
| 4 | package OPP::Proc::Fieldcount; | ||||||||||||
| 5 | 1 | ▶ | use strict; | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 6 | 1 | ▶ | use warnings; | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 7 | |||||||||||||
| 8 | 1 | ▶ | use base qw(OPP::Proc); | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 9 | 1 | __PACKAGE__->cgBuildIndices; | |||||||||||
| 10 | |||||||||||||
| 11 | 1 | our $VERSION = '1.00'; | |||||||||||
| 12 | |||||||||||||
| 13 | # | ||||||||||||
| 14 | # | fieldcount domain | ||||||||||||
| 15 | # | ||||||||||||
| 16 | sub process { | ||||||||||||
| 17 | 0 | ▶ | my $self = shift; | ||||||||||
|
Subroutine
process: not called CC=3 SCAR=24.8
Pod
undocumented
| |||||||||||||
| 18 | 0 | my ($input) = @_; | |||||||||||
| 19 | |||||||||||||
| 20 | 0 | ▶ | my $field = $self->options->{0} || {}; | ||||||||||
|
Condition0%0/2
$self->options->{'0'} || {}
MC/DC0%0/1
$self->options->{'0'} || {}
$self->options->{'0'}
Truth table0%0/2
A
A= $self->options->{'0'}
| |||||||||||||
| 21 | |||||||||||||
| 22 | 0 | my $values = $self->value($input, $field); | |||||||||||
| 23 | 0 | ▶ | return 1 unless defined($values); # No field in doc, skip it | ||||||||||
|
Branch: 1 branch
| |||||||||||||
| 24 | |||||||||||||
| 25 | 0 | my $new_fieldname = $field.'count'; | |||||||||||
| 26 | 0 | $new_fieldname =~ s{\.}{}g; | |||||||||||
| 27 | |||||||||||||
| 28 | # Update document with count field: | ||||||||||||
| 29 | 0 | $input->{$new_fieldname} = @$values; | |||||||||||
| 30 | |||||||||||||
| 31 | 0 | $self->output->add($input); | |||||||||||
| 32 | |||||||||||||
| 33 | 0 | return 1; | |||||||||||
| 34 | } | ||||||||||||
| 35 | |||||||||||||
| 36 | 1 | 1; | |||||||||||
| 37 | |||||||||||||
| 38 | __END__ | ||||||||||||