Switch::Perlish::Smatch::Comparators - Overall document for comparator behaviour.
Below is a complete listing of the default comparators that come with Switch::Perlish.
In each comparator description $t
refers to the topic and $m
refers to the match,
or the first and second arguments,
respectively.
Smatch for an element of @$m
in @$t
.
Call &$m
with @$t
.
Check if an element of @$t
exists as a key in %$m
.
Check if an element of @$t
exists as a method of $m
.
Match $m
against the elements of @$t
.
Check if $m
points to an element of @$t
.
Return false as $t
is already defined.
Smatch for $m
in @$t
.
Check if $m
refers to $t
.
Pass %$m
to $t
.
Pass @$m
to $t
.
Pass $m
to $t
.
Pass $m
to $t
.
Call $t
with $m
.
Call $t
with $m
.
Check if an element of @$m
exists as a key of %$t
.
Check if the return from &$m
is a hash key of %$t
.
Check if a key => value
pair exists in both %$t
and %$m
.
Check if a key of %$t
exists as a method of $m
.
Check if any keys from %$t
match $m
.
Check if $m
points to value in %$t
.
Check for an undefined value in %$t
(better suggestions welcome).
Check if $m
exists as a key in %$t
.
If the $t
is a blessed ARRAY,
delegate to the ARRAY<=>ARRAY
comparator,
otherwise returns false.
Call the $t
on &$m
i.e $t->$m
.
If the $t
is a blessed HASH,
delegate to the HASH<=>HASH
comparator,
otherwise returns false.
Check if the $t->isa($m)
or the same class (better suggestions welcome).
Match the class of $t
against the $m
.
Check if the $m
points to the $t
.
croak("Can't compare OBJECT with an undef") # Suggestions welcome.
Check if $t
has $m
as a method.
Match $t
for every element in @$m
.
Pass $t
to &$m
.
Check if any of keys of %$m
match $t
.
Match $t
against $m
's class.
Match $m
to $t
.
Check if $m
refers to $t
.
croak("Can't compare Regexp with an undef") # suggestions welcome.
Match $t
against $m
.
Check if $t
points to an element of @$m
.
Check if $t
points to $m
.
Check if $t
points to value in %$m
.
Check if $t
refers to the object $m
.
Check if $t
refers to the Regexp object $m
.
Numerically compare the scalar refs $t
and $m
.
Check if $$t
is undef.
Call Switch::Perlish::Smatch::value_cmp() with $$t
and $m
.
Check for an undef in @$m
.
Pass undef to &$m
(to be consistent with other CODE comparators).
Check for an undefined value in %$m
(better suggestions welcome).
croak("Can't compare undef with OBJECT") # Suggestions welcome.
croak("Can't compare undef with Regexp") # Suggestions welcome.
Check if $$m
is undef.
Return true as $m
is also undefined.
Return false as $m
is already defined.
Check if $t
is in $m
.
Pass $t
to &$m
.
Check if $t
exists as a key in $m
.
Check if the method $t
exists in $m
.
Match $t
against $m
.
Check if what $$m
is the same as $t
.
Return false,
a VALUE
is always defined.
Call Switch::Perlish::Smatch::value_cmp() with $t
and $m
.
Dan Brook <mr.daniel.brook
@gmail
.com>
Copyright (c) 2006, Dan Brook. All Rights Reserved. This module is free software. It may be used, redistributed and/or modified under the same terms as Perl itself.