perl-Data-Predicate - >apply(1); #returns true

Property Value
Distribution ALT Linux Sisyphus
Repository Autoimports noarch
Package filename perl-Data-Predicate-2.1.1-alt1.noarch.rpm
Package name perl-Data-Predicate
Package version 2.1.1
Package release alt1
Package architecture noarch
Package type rpm
Category Development/Perl
Homepage -
License -
Maintainer -
Download size 28.56 KB
Installed size 28.56 KB
This idea of predicates is taken from
the section on "/'" in the <a href='http: manpageApache Commons collections</a>>
and the section on "/'" in the <a href='http: manpagegoogle-collections</a>>.
Predicates are a way of composing logic so it eventually reports a true/false
for a given value. The criteria for coming up with this reponse could be
quite complex but always the answer has to be boolean. The predicates
can also do filtering of an array reference of items and do transformations
on those items when a predicate returns true.
Predicates also allow for more complex and/or statements to be built. For
use Data::Predicate::Predicates qw(:all);
my $or_predicate = p_or(map { p_string_equals($_) } qw(a b c d e f) );
my $and_predicate = p_and( p_defined(), $or_predicate );
my $truth = $and_predicate->apply('a');
$truth = $and_predicate->apply('d');
$truth = $and_predicate->apply('f');
This is functionally equivalent to:
my ($v) = @_;
if(defined $v && ( $v eq 'a' || $v eq 'b' || $v eq 'c' || $v eq 'd' || $v eq 'e' || $v eq 'f')) {
This or code will also begin to shortcut operations in the same way the above
if statement would have done.
However one word of warning is that you should not use predicates for matters
where simple logic will suffice. Do not use it when doing simple if tests
or simple list grepping. Predicates are not a Perlism and will make your
code harder to read to the un-initiated.


Package Version Architecture Repository
perl-Data-Predicate - - -


Name Value
/usr/share/perl5 -
perl( -
perl(Scalar/ -
perl( -
rpmlib(PayloadIsLzma) -


Name Value
perl(Data/ = 2.001.001
perl(Data/Predicate/ -
perl(Data/Predicate/ -
perl-Data-Predicate = 2.1.1-alt1


Type URL
Binary Package perl-Data-Predicate-2.1.1-alt1.noarch.rpm
Source Package perl-Data-Predicate-2.1.1-alt1.src.rpm

Install Howto

  1. Add the following line to /etc/apt/sources.list:
    rpm [Sisyphus] noarch autoimports
    rpm [Sisyphus] noarch autoimports
  2. Update the package index:
    # sudo apt-get update
  3. Install perl-Data-Predicate rpm package:
    # sudo apt-get install perl-Data-Predicate



See Also

Package Description
perl-Data-Presenter-1.03-alt1.noarch.rpm Reformat database reports
perl-Data-PrettyPrintObjects-1.00-alt1.noarch.rpm a pretty printing module with better support for objects
perl-Data-PrintUtils-0.12-alt2.noarch.rpm A Collection of Pretty Print routines like Data::Dumper
perl-Data-Printer-Filter-ClassicRegex-0.01-alt1.noarch.rpm print regexes the classic qr// way
perl-Data-Printer-Filter-DBIx-Class-0.000004-alt1.noarch.rpm Apply special Data::Printer filters to DBIx::Class objects
perl-Data-Printer-Filter-JSON-0.3-alt1.noarch.rpm pretty-print your decoded JSON structures!
perl-Data-Printer-Filter-PDL-0.007-alt1.noarch.rpm Filter for L<Data::Printer> that handles L<PDL> data
perl-Data-Printer-Filter-URI-0.008-alt1.noarch.rpm pretty-printing URI objects
perl-Data-Printer-Scoped-0.001004-alt1.noarch.rpm silence Data::Printer except in a controlled scope
perl-Data-PrioQ-SkewBinomial-0.03-alt1.noarch.rpm A functional priority queue based on skew binomial trees
perl-Data-Processor-1.0.2-alt1.noarch.rpm Transform Perl Data Structures, Validate Data against a Schema, Produce Data from a Schema, or prod
perl-Data-Promise-0.001-alt1.noarch.rpm simple promise like interface
perl-Data-Properties-0.02-alt1_25.noarch.rpm Persistent properties
perl-Data-Properties-JSON-0.004-alt1.noarch.rpm JSON test fixtures
perl-Data-Properties-YAML-0.04-alt1.noarch.rpm YAML-ized properties for your application