diff options
author | Chip Salzenberg <chip@pobox.com> | 2008-11-13 16:44:36 -0800 |
---|---|---|
committer | H.Merijn Brand <h.m.brand@xs4all.nl> | 2008-11-14 12:37:01 +0000 |
commit | e23d9e2f39425eea292ee5999c974fdc2cdd98b8 (patch) | |
tree | dfc9224eeb4048f96a454d8554932ff0ea226d95 /pp_hot.c | |
parent | fc8f615e0f1bfc61d321240c5d49d61e3e6f6939 (diff) | |
download | perl-e23d9e2f39425eea292ee5999c974fdc2cdd98b8.tar.gz |
[perl #948] [PATCH] Allow tied $,
Message-ID: <20081114084436.GJ5779@tytlal.topaz.cx>
p4raw-id: //depot/perl@34831
Diffstat (limited to 'pp_hot.c')
-rw-r--r-- | pp_hot.c | 6 |
1 files changed, 4 insertions, 2 deletions
@@ -753,14 +753,16 @@ PP(pp_print) goto just_say_no; } else { + SV * const ofs = GvSV(PL_ofsgv); /* $, */ MARK++; - if (PL_ofs_sv && SvOK(PL_ofs_sv)) { + if (ofs && (SvGMAGICAL(ofs) || SvOK(ofs))) { while (MARK <= SP) { if (!do_print(*MARK, fp)) break; MARK++; if (MARK <= SP) { - if (!do_print(PL_ofs_sv, fp)) { /* $, */ + /* don't use 'ofs' here - it may be invalidated by magic callbacks */ + if (!do_print(GvSV(PL_ofsgv), fp)) { MARK--; break; } |