Any CodeRef scalar sub truth $b->($a)
Hash Hash hash keys identical [sort keys %$a]~~[sort keys %$b]
- Array Hash hash slice existence @$a == grep {exists $b->{$_}} @$a
+ Array Hash hash slice existence[1] @$a == grep {exists $b->{$_}} @$a
Regex Hash hash key grep[1] grep /$a/, keys %$b
undef Hash always false (undef can't be a key)
Any Hash hash entry existence exists $b->{$a}
# HASH ref against:
# - another hash ref
{} {}
-! {} {1 => 2}
+=! {} {1 => 2}
{1 => 2} {1 => 2}
{1 => 2} {1 => 3}
! {1 => 2} {2 => 3}
# - an array ref
[keys %main::] \%::
! [] \%::
+! [""] {}
+! [] {}
[undef] {"" => 1}
+ [""] {"" => 1}
["foo"] { foo => 1 }
["foo", "bar"] { foo => 1 }
["foo", "bar"] \%hash
# - a regex
qr/^(fo[ox])$/ {foo => 1}
! qr/[13579]$/ +{0..99}
+! qr/a*/ {}
+ qr/a*/ {b=>2}
# - a string
"foo" +{foo => 1, bar => 2}
# - undef
! undef %hash
! undef +{"" => "empty key"}
+! undef {}
# ARRAY ref against:
# - another array ref