diff options
author | Nick Ing-Simmons <nik@tiuk.ti.com> | 2000-11-18 20:17:22 +0000 |
---|---|---|
committer | Nick Ing-Simmons <nik@tiuk.ti.com> | 2000-11-18 20:17:22 +0000 |
commit | ac27b0f573239284c298fcf96fb6c966551ef207 (patch) | |
tree | 13447eed9b72cd6cfd50796c13cabbf22c4383d6 /pp_sys.c | |
parent | b931b1d952313afa398828ff4b2a40af20cfa65a (diff) | |
download | perl-ac27b0f573239284c298fcf96fb6c966551ef207.tar.gz |
Lexical use open ... support:
add ->cop_io to COP structure in cop.h.
Make mg.c and gv.c associate it with ${^OPEN}.
Make lib/open.pm set it.
Have sv.c, perl.c, pp_ctl.c, op.c manipulate it in a manner
manner similar to ->cop_warnings.
Have doio.c's do_open9 and pp_sys.c's pp_backticks use it as default and
call new PerlIO_apply_layers().
Declare latter in perlio.h and define in perlio.c
p4raw-id: //depot/perlio@7740
Diffstat (limited to 'pp_sys.c')
-rw-r--r-- | pp_sys.c | 10 |
1 files changed, 10 insertions, 0 deletions
@@ -302,6 +302,16 @@ PP(pp_backtick) mode = "rt"; fp = PerlProc_popen(tmps, mode); if (fp) { + char *type = NULL; + if (PL_curcop->cop_io) { + type = SvPV_nolen(PL_curcop->cop_io); + } + else if (O_BINARY != O_TEXT) { + type = ":crlf"; + } + if (type && *type) + PerlIO_apply_layers(aTHX_ fp,mode,type); + if (gimme == G_VOID) { char tmpbuf[256]; while (PerlIO_read(fp, tmpbuf, sizeof tmpbuf) > 0) |