summaryrefslogtreecommitdiff
path: root/gv.c
diff options
context:
space:
mode:
authorBen Morrow <ben@morrow.me.uk>2009-10-27 15:55:36 +0000
committerRafael Garcia-Suarez <rgs@consttype.org>2009-11-01 16:18:04 +0100
commitd4b87e753f3c5c8123aeebb4ae822cef9f2eed3c (patch)
tree3c7862ff6f2e50fe703a6a6fefa7dfd84314e3f3 /gv.c
parentd9151963660fed8e24ee268776a238e1d9ae6802 (diff)
downloadperl-d4b87e753f3c5c8123aeebb4ae822cef9f2eed3c.tar.gz
Implement the 'qr' overload type.
If this is defined, it will be called instead of stringification whenever an object is used as a regexp or interpolated into a regexp. This will fall back to stringification even without C<fallback => 1>, for compatibility. An overloaded 'qr' must return either a REGEXP or a ref to a REGEXP (such as created by qr//). Any further overloading on the return value will be ignored.
Diffstat (limited to 'gv.c')
-rw-r--r--gv.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/gv.c b/gv.c
index 22af274c2f..3e225bc270 100644
--- a/gv.c
+++ b/gv.c
@@ -1963,6 +1963,7 @@ Perl_amagic_call(pTHX_ SV *left, SV *right, int method, int flags)
case int_amg:
case iter_amg: /* XXXX Eventually should do to_gv. */
case ftest_amg: /* XXXX Eventually should do to_gv. */
+ case regexp_amg:
/* FAIL safe */
return NULL; /* Delegate operation to standard mechanisms. */
break;