From: Rafael Garcia-Suarez Date: Tue, 12 May 2009 12:09:02 +0000 (+0200) Subject: Register ~~ operator overloading in its own category in %overload::ops X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=ae20c3aa7c1b22aa5d270fcda2d83ea1f5e96c46;p=p5sagit%2Fp5-mst-13.2.git Register ~~ operator overloading in its own category in %overload::ops (This category might get reused later if we manage to overload =~) --- diff --git a/lib/overload.pm b/lib/overload.pm index da114c5..a384568 100644 --- a/lib/overload.pm +++ b/lib/overload.pm @@ -138,6 +138,7 @@ sub mycan { # Real can would leave stubs. iterators => '<>', filetest => "-X", dereferencing => '${} @{} %{} &{} *{}', + matching => '~~', special => 'nomethod fallback ='); use warnings::register; @@ -448,6 +449,11 @@ treated as a filename. This overload was introduced in perl 5.12. +=item * I + +The key C<"~~"> allows you to override the smart matching used by +the switch construct. See L. + =item * I '${}', '@{}', '%{}', '&{}', '*{}'. @@ -464,7 +470,7 @@ The dereference operators must be specified explicitly they will not be passed t =item * I - "nomethod", "fallback", "=", "~~", + "nomethod", "fallback", "=". see L>. @@ -489,6 +495,7 @@ A computer-readable form of the above table is available in the hash iterators => '<>', filetest => '-X', dereferencing => '${} @{} %{} &{} *{}', + matching => '~~', special => 'nomethod fallback =' =head2 Inheritance and overloading @@ -585,11 +592,6 @@ C<"nomethod"> value, and if this is missing, raises an exception. B C<"fallback"> inheritance via @ISA is not carved in stone yet, see L<"Inheritance and overloading">. -=head2 Smart Match - -The key C<"~~"> allows you to override the smart matching used by -the switch construct. See L. - =head2 Copy Constructor The value for C<"="> is a reference to a function with three