Convert tied WRITE to using S_tied_handle_method()
authorNicholas Clark <nick@ccl4.org>
Tue, 4 Jan 2011 16:59:46 +0000 (16:59 +0000)
committerNicholas Clark <nick@ccl4.org>
Tue, 4 Jan 2011 16:59:46 +0000 (16:59 +0000)
pp_sys.c

index 302a569..57e4730 100644 (file)
--- a/pp_sys.c
+++ b/pp_sys.c
@@ -1848,12 +1848,9 @@ PP(pp_send)
                PUTBACK;
            }
 
-           PUSHMARK(ORIGMARK);
-           *(ORIGMARK+1) = SvTIED_obj(MUTABLE_SV(io), mg);
-           ENTER;
-           call_method("WRITE", G_SCALAR);
-           LEAVE;
-           return NORMAL;
+           return S_tied_handle_method(aTHX_ "WRITE", mark - 1, io, mg,
+                                       G_SCALAR | ARGUMENTS_ON_STACK
+                                       | (sp - mark) << TIED_HANDLE_ARGC_SHIFT);
        }
     }
     if (!gv)