summaryrefslogtreecommitdiff
path: root/pp.c
diff options
context:
space:
mode:
authorFather Chrysostomos <sprout@cpan.org>2011-08-29 13:43:17 -0700
committerFather Chrysostomos <sprout@cpan.org>2011-08-29 13:43:17 -0700
commitefe889ae38a5f2c6e26a31f33186cd13d4946962 (patch)
tree6fc393503a521c25fe8ae028298605c78fbcac34 /pp.c
parentb64a1294cf75eebd873e05ee3b771d165893ed3b (diff)
downloadperl-efe889ae38a5f2c6e26a31f33186cd13d4946962.tar.gz
&CORE::foo() for tie functions
This commit allows the tie, tied and untie subroutines in the CORE namespace to be called through references and via &ampersand() syntax. pp_coreargs is modified to handle the functions with \[$@%*] in their prototypes (which happen to be just the tie functions).
Diffstat (limited to 'pp.c')
-rw-r--r--pp.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/pp.c b/pp.c
index 630dd12096..8057c692be 100644
--- a/pp.c
+++ b/pp.c
@@ -6097,7 +6097,9 @@ PP(pp_coreargs)
*foo is indistinguishable from ${\*foo}, and the proto-
type permits the latter. */
|| SvTYPE(SvRV(*svp)) > (
- wantscalar ? SVt_PVLV : SVt_PVCV
+ wantscalar ? SVt_PVLV
+ : opnum == OP_LOCK ? SVt_PVCV
+ : SVt_PVHV
)
)
DIE(aTHX_
@@ -6106,7 +6108,9 @@ PP(pp_coreargs)
whicharg, OP_DESC(PL_op->op_next),
wantscalar
? "scalar reference"
- : "reference to one of [$@%&*]"
+ : opnum == OP_LOCK
+ ? "reference to one of [$@%&*]"
+ : "reference to one of [$@%*]"
);
PUSHs(SvRV(*svp));
break;