Catmandu::Fix::Condition::SimpleCompareTest(3pm)

Catmandu::Fix::Condition::SimpleCompareTest3pm

Base class to ease the construction of compare conditionals

Usage

   package Catmandu::Fix::Condition::has_equal_type
   use Catmandu::Sane;
   use Moo;
   use Catmandu::Fix::Has;
   has path  => (fix_arg => 1);
   has path2 => (fix_arg => 1);
   with 'Catmandu::Fix::Condition::SimpleCompareTest';
   sub emit_test {
       my ($self, $var, $var2, $fixer) = @_;
       "is_value(${var}) && is_value(${var2}) && ref ${var} eq ref ${var2}";
   }
   1;
   # Now you can write in your fixes
   has_equal_type(my_field_1,my_field_2)  # True when my_field_1 and my_field_2 have
                                          # the same refence type (both scalas, arrays, hashes)

Releases

5 releases since Debian 9 (Stretch); the text changed 4 times.

  1. 9
  2. 10
  3. 11
  4. 12
  5. 13

From libcatmandu-perl 1.2024-1 in Debian 13 (Trixie). Parsed by carta from the page's man source.