diff options
author | Father Chrysostomos <sprout@cpan.org> | 2011-08-25 17:59:12 -0700 |
---|---|---|
committer | Father Chrysostomos <sprout@cpan.org> | 2011-08-25 23:02:09 -0700 |
commit | 30901a8a3fcf590cb60375fd3b39c6b0d0bf6e00 (patch) | |
tree | 2fe79e70e0e8643f19efbfa4154f2279408f4040 /pp.c | |
parent | 64a8239ec9dfc1bed7de64084b6c65e6e05f72f5 (diff) | |
download | perl-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.c | 3 |
1 files changed, 2 insertions, 1 deletions
@@ -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)); |