Skip to content

Commit 22d688c

Browse files
author
GomoR
committed
- new: file
1 parent deebe86 commit 22d688c

1 file changed

Lines changed: 54 additions & 0 deletions

File tree

lib/OPP/Proc/Exists.pm

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
#
2+
# $Id: Exists.pm,v a82704bbf31a 2024/02/04 14:25:56 gomor $
3+
#
4+
package OPP::Proc::Exists;
5+
use strict;
6+
use warnings;
7+
8+
use base qw(OPP::Proc);
9+
__PACKAGE__->cgBuildIndices;
10+
11+
our $VERSION = '1.00';
12+
13+
#
14+
# | exists cpe
15+
#
16+
sub process {
17+
my $self = shift;
18+
my ($input) = @_;
19+
20+
my $field = $self->options->{0} or return;
21+
22+
my $values = $self->value($input, $field);
23+
# Field by that name, we keep original input untouched:
24+
$self->output->add($input) if defined $values;
25+
26+
# Otherwise, we skip it.
27+
28+
return 1;
29+
}
30+
31+
1;
32+
33+
__END__
34+
35+
=head1 NAME
36+
37+
OPP::Proc::Exists - exists processor
38+
39+
=head1 SYNOPSIS
40+
41+
=head1 DESCRIPTION
42+
43+
=head1 COPYRIGHT AND LICENSE
44+
45+
Copyright (c) 2024, Patrice E<lt>GomoRE<gt> Auffret
46+
47+
You may distribute this module under the terms of The BSD 3-Clause License.
48+
See LICENSE file in the source distribution archive.
49+
50+
=head1 AUTHOR
51+
52+
Patrice E<lt>GomoRE<gt> Auffret
53+
54+
=cut

0 commit comments

Comments
 (0)