---
name: "Catmandu::Fix::Condition::SimpleCompareTest"
section: "3pm"
platform: "linux"
package: "libcatmandu-perl"
version: "1.2024-1"
release: "Debian 13 (Trixie)"
platforms: ["linux"]
url: "https://new.carta.tech/Catmandu::Fix::Condition::SimpleCompareTest"
---

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

Base class to ease the construction of compare conditionals

## NAME

Catmandu::Fix::Condition::SimpleCompareTest - Base class to ease the construction of compare conditionals

## SYNOPSIS

```
   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)
```

## SEE ALSO

Catmandu::Fix::Condition::SimpleAllTest, Catmandu::Fix::Condition::SimpleAnyTest
