summaryrefslogtreecommitdiff
path: root/pp.c
diff options
context:
space:
mode:
authorFather Chrysostomos <sprout@cpan.org>2011-08-25 17:59:12 -0700
committerFather Chrysostomos <sprout@cpan.org>2011-08-25 23:02:09 -0700
commit30901a8a3fcf590cb60375fd3b39c6b0d0bf6e00 (patch)
tree2fe79e70e0e8643f19efbfa4154f2279408f4040 /pp.c
parent64a8239ec9dfc1bed7de64084b6c65e6e05f72f5 (diff)
downloadperl-30901a8a3fcf590cb60375fd3b39c6b0d0bf6e00.tar.gz
&CORE::foo() for close, getc and readline
This commit allows the subs in the CORE package for close, getc and readline to be called through references and via ampersand syntax. The pp functions are modified to take into account the nulls that coreargs pushes on to the stack to indicate that there is no argument.
Diffstat (limited to 'pp.c')
-rw-r--r--pp.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/pp.c b/pp.c
index 19ba8bc5df..1a92796d91 100644
--- a/pp.c
+++ b/pp.c
@@ -6085,7 +6085,8 @@ PP(pp_coreargs)
}
RETURN;
case OA_FILEREF:
- if(svp && *svp && SvROK(*svp) && isGV_with_GP(SvRV(*svp)))
+ if (!numargs) PUSHs(NULL);
+ else if(svp && *svp && SvROK(*svp) && isGV_with_GP(SvRV(*svp)))
/* no magic here, as the prototype will have added an extra
refgen and we just want what was there before that */
PUSHs(SvRV(*svp));