Catman...AllTest(3pm)
π NAME π
Catmandu::Fix::Condition::SimpleAllTest β bestie, it's the base class that makes building "all match" conditionals so much easier π
β¨ SYNOPSIS β¨
package Catmandu::Fix::Condition::is_even
use Catmandu::Sane;
use Moo;
use Catmandu::Fix::Has;
has path => (fix_arg => 1);
with 'Catmandu::Fix::Condition::SimpleAllTest';
sub emit_test {
my ($self, $var) = @_;
"is_value(${var}) && ${var} % 2 == 0";
}
1;
# Now you can write in your fixes
is_even('my_field') # True when my_field is 0,2,4,6,...
is_even('my_field.*') # True when all my_field's are 0,2,4,6,...
okay so literally you roll your own condition, you with 'Catmandu::Fix::Condition::SimpleAllTest', and boom π₯ β you get both the single-field vibe and the all-the-fields vibe for free. The way that is_even('my_field') is true when my_field is 0,2,4,6,... and is_even('my_field.*') is true when all of my_field's are 0,2,4,6,...? Obsessed. π
πΈ DESCRIPTION πΈ
So this is a base class, and its whole job is to ease the construction of Catmandu::Fix::Conditional-s π«Ά. An 'all' test matches when all node on a path match a condition β every single one, no skips, no cap. fr fr.
Like, check it:
all_match('title','abc') # true when the title field contains 'abc'
all_match('title.*','abc') # true when all title fields contain 'abc'
See the difference? First one is giving one field, one vibe. Second one with the .* is giving every title field must pass π
β if even one of them doesn't contain 'abc', the whole test says nope.
π SEE ALSO π
Catmandu::Fix::Condition::all_matchCatmandu::Fix::Condition::greater_thanCatmandu::Fix::Condition::less_than
and that's the whole page, bestie π¦ β this one's from perl v5.40.1, dated 2026-01-24, and it lives under Catman...AllTest(3pm). go build something iconic with it, ily, bye πβ¨
π¦ where this page comes from
- ubuntu resolute: libcatmandu-perl 1.2025-1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu stonking: libcatmandu-perl 1.2025-1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms