are. The behaviour is determined by the following table: the first row
that applies determines the match behaviour (which is thus mostly
determined by the type of the right operand). Note that the smart match
-implicitly dereferences any hash or array ref, so the "Hash" and "Array"
-entries apply in those cases.
+implicitly dereferences any non-blessed hash or array ref, so the "Hash"
+and "Array" entries apply in those cases. (For blessed references, the
+"Any" entry apply.)
$a $b Type of Match Implied Matching Code
====== ===== ===================== =============
qr// \&bar
! [1] \&foo
! {a=>1} \&foo
+ $obj sub { ref $_[0] =~ /NoOverload/ } TODO
+ $ov_obj sub { ref $_[0] =~ /CopyOverload/ } TODO
# empty stuff matches, because the sub is never called:
[] \&foo
{} \&foo
= \@nums @tied_nums
= @nums @tied_nums
+# - an object
+! $obj @fooormore
+ $obj [sub{ref shift}] TODO
+
# - works with lists instead of arrays
"foo" qw(foo bar) TODO
"foo" ('foo','bar') TODO