NAME
Syntax::Infix::EqualityInsensitive - case-insensitive eqi and nei infix operators
VERSION
Version 0.02
SYNOPSIS
use Syntax::Infix::EqualityInsensitive;
if ($input eqi 'yes') { ... } # true for 'YES', 'Yes', 'yes', ...
if ($status nei 'OK') { ... } # true unless case-insensitively 'ok'
# correct Unicode case-folding
use utf8;
say 'match' if "Stra\x{df}e" eqi 'STRASSE'; # German sharp-s
DESCRIPTION
Installs two lexically-scoped infix operators for Unicode case-insensitive string comparison:
$a eqi $b-
True if
$aand$bare equal under Unicode case-folding (fc). $a nei $b-
True if
$aand$bare not equal under Unicode case-folding.
Both operators sit at rel precedence (peer of eq and ne) and are non-associative.
Implementation
Both operands are upgraded to UTF-8 and compared with foldEQ_utf8 - the same case-folding routine Perl uses for /i regex matching and the built-in fc function. This gives correct Unicode case-folding rather than the ASCII-only lc/tolower approach.
Each operator lowers to a custom OP_CUSTOM BINOP via Infix::Custom's build_op escape hatch; there is no ENTERSUB wrapper at runtime.
Lexical scope
Active only inside the file or block that used the module. no Syntax::Infix::EqualityInsensitive removes both operators early.
Perl version
Requires Perl 5.38 or newer (the PL_infix_plugin hook used by Infix::Custom).
SEE ALSO
Infix::Custom, Syntax::Infix::Coalesce, Syntax::Infix::OptionalChain, Syntax::Infix::ConditionalSplice
AUTHOR
LNATION <email@lnation.org>
LICENSE AND COPYRIGHT
This software is Copyright (c) 2026 by LNATION <email@lnation.org>.
This is free software, licensed under The Artistic License 2.0 (GPL Compatible).