diff options
author | Nicholas Clark <nick@ccl4.org> | 2006-05-20 17:29:52 +0000 |
---|---|---|
committer | Nicholas Clark <nick@ccl4.org> | 2006-05-20 17:29:52 +0000 |
commit | 11bcd5dad4f9d911a9454f9d858c2dd0d14ddf2a (patch) | |
tree | 24e3ac38c69f46172a4cf4ac1aeabe4488829631 /mg.c | |
parent | d5ec2987912a76b3059b7bd1d06cf02b4d0dae0c (diff) | |
download | perl-11bcd5dad4f9d911a9454f9d858c2dd0d14ddf2a.tar.gz |
Abolish cop_io (the simple way) by storing the value in cop_hints_hash.
Todo - store the in and out values under 2 keys, and avoid the need to
create a temporary mortal SV while checking it.
p4raw-id: //depot/perl@28258
Diffstat (limited to 'mg.c')
-rw-r--r-- | mg.c | 16 |
1 files changed, 10 insertions, 6 deletions
@@ -758,10 +758,13 @@ Perl_magic_get(pTHX_ SV *sv, MAGIC *mg) SvTAINTED_off(sv); } else if (strEQ(remaining, "PEN")) { - if (!PL_compiling.cop_io) + if (!(CopHINTS_get(&PL_compiling) & HINT_LEXICAL_IO)) sv_setsv(sv, &PL_sv_undef); else { - sv_setsv(sv, PL_compiling.cop_io); + sv_setsv(sv, + Perl_refcounted_he_fetch(aTHX_ + PL_compiling.cop_hints_hash, + 0, "open", 4, 0, 0)); } } break; @@ -2230,10 +2233,11 @@ Perl_magic_set(pTHX_ SV *sv, MAGIC *mg) } } else if (strEQ(mg->mg_ptr, "\017PEN")) { - if (!PL_compiling.cop_io) - PL_compiling.cop_io = newSVsv(sv); - else - sv_setsv(PL_compiling.cop_io,sv); + PL_compiling.cop_hints |= HINT_LEXICAL_IO; + PL_hints |= HINT_LOCALIZE_HH | HINT_LEXICAL_IO; + PL_compiling.cop_hints_hash + = Perl_refcounted_he_new(aTHX_ PL_compiling.cop_hints_hash, + sv_2mortal(newSVpvs("open")), sv); } break; case '\020': /* ^P */ |