summaryrefslogtreecommitdiff
path: root/op.c
diff options
context:
space:
mode:
authorDavid Mitchell <davem@iabyn.com>2011-01-02 19:38:30 +0000
committerDavid Mitchell <davem@iabyn.com>2011-01-02 20:00:27 +0000
commit9426e1a55981168c83a030df9bce5e0b46586581 (patch)
tree9693090582930b7f145f2050c847bd2f87f9ed0d /op.c
parentbff33ce02f3be5fbb5af2c3c92e9853aaa12151e (diff)
downloadperl-9426e1a55981168c83a030df9bce5e0b46586581.tar.gz
make <expr> always overload if expr is overloaded
Due to the way that '<> as glob' was parsed differently from '<> as filehandle' from 5.6 onwards, something like <$foo[0]> didn't handle overloading, even where $foo[0] was an overloaded object. This was contrary to the docs for overload, and meant that <> couldn't be used as a general overloaded iterator operator.
Diffstat (limited to 'op.c')
-rw-r--r--op.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/op.c b/op.c
index a1b11a2d97..f7c8d71f95 100644
--- a/op.c
+++ b/op.c
@@ -7678,6 +7678,7 @@ Perl_ck_glob(pTHX_ OP *o)
* \ null - const(wildcard) - const(ix)
*/
o->op_flags |= OPf_SPECIAL;
+ o->op_targ = pad_alloc(OP_GLOB, SVs_PADTMP);
op_append_elem(OP_GLOB, o,
newSVOP(OP_CONST, 0, newSViv(PL_glob_index++)));
o = newLISTOP(OP_LIST, 0, o, NULL);