diff options
author | Ben Morrow <ben@morrow.me.uk> | 2009-10-27 15:55:36 +0000 |
---|---|---|
committer | Rafael Garcia-Suarez <rgs@consttype.org> | 2009-11-01 16:18:04 +0100 |
commit | d4b87e753f3c5c8123aeebb4ae822cef9f2eed3c (patch) | |
tree | 3c7862ff6f2e50fe703a6a6fefa7dfd84314e3f3 /gv.c | |
parent | d9151963660fed8e24ee268776a238e1d9ae6802 (diff) | |
download | perl-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.c | 1 |
1 files changed, 1 insertions, 0 deletions
@@ -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; |