diff options
author | Nicholas Clark <nick@ccl4.org> | 2011-01-05 13:19:50 +0000 |
---|---|---|
committer | Nicholas Clark <nick@ccl4.org> | 2011-01-05 13:19:50 +0000 |
commit | 94bc412f1f7b3d506c2ea51a781e3dd55c1c8492 (patch) | |
tree | cf3267f0e8e723cac7dea8316d10d526883d1faa /pp_sys.c | |
parent | af71faff9cab9c988715157db11d9f43f66b98f3 (diff) | |
download | perl-94bc412f1f7b3d506c2ea51a781e3dd55c1c8492.tar.gz |
Convert tied PRINT to using Perl_tied_method()
Add a flag TIED_METHOD_SAY to Perl_tied_method(), to allow tied PRINT to
effect C<local $\ = "\n";> within the ENTER/LEAVE pair of Perl_tied_method().
Diffstat (limited to 'pp_sys.c')
-rw-r--r-- | pp_sys.c | 6 |
1 files changed, 6 insertions, 0 deletions
@@ -516,6 +516,7 @@ Perl_tied_method(pTHX_ const char *const methname, SV **sp, SV *const sv, /* Ensure that our flag bits do not overlap. */ assert((TIED_METHOD_MORTALIZE_NOT_NEEDED & G_WANT) == 0); assert((TIED_METHOD_ARGUMENTS_ON_STACK & G_WANT) == 0); + assert((TIED_METHOD_SAY & G_WANT) == 0); PUSHMARK(sp); PUSHs(SvTIED_obj(sv, mg)); @@ -538,6 +539,11 @@ Perl_tied_method(pTHX_ const char *const methname, SV **sp, SV *const sv, PUTBACK; ENTER_with_name("call_tied_method"); + if (flags & TIED_METHOD_SAY) { + /* local $\ = "\n" */ + SAVEGENERICSV(PL_ors_sv); + PL_ors_sv = newSVpvs("\n"); + } call_method(methname, flags & G_WANT); LEAVE_with_name("call_tied_method"); return NORMAL; |