diff options
author | Rafael Garcia-Suarez <rgs@consttype.org> | 2014-07-24 17:43:29 +0200 |
---|---|---|
committer | Rafael Garcia-Suarez <rgs@consttype.org> | 2014-09-30 08:17:50 +0200 |
commit | 157fb5a14d10ed16ffc6ebfc43d2637a016fdfce (patch) | |
tree | b2410287e269d41f3295678586e62ce4fa459188 /pp_hot.c | |
parent | f276fdad8f6660f36944c895587a7748585e4969 (diff) | |
download | perl-157fb5a14d10ed16ffc6ebfc43d2637a016fdfce.tar.gz |
Introduce the double-diamond operator <<>>
This operator works like <> or <ARGV>, as it reads the list of file
names to open from the command-line arguments. However, it disables
the magic-open feature (that forks to execute piped commands) :
$ bleadperl -e 'while(<>){print}' 'echo foo |'
foo
$ bleadperl -e 'while(<<>>){print}' 'echo foo |'
Can't open echo foo |: No such file or directory at -e line 1.
Diffstat (limited to 'pp_hot.c')
-rw-r--r-- | pp_hot.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -1588,7 +1588,7 @@ Perl_do_readline(pTHX) goto have_fp; } } - fp = nextargv(PL_last_in_gv); + fp = nextargv(PL_last_in_gv, PL_op->op_flags & OPf_SPECIAL); if (!fp) { /* Note: fp != IoIFP(io) */ (void)do_close(PL_last_in_gv, FALSE); /* now it does*/ } @@ -1675,7 +1675,7 @@ Perl_do_readline(pTHX) { PerlIO_clearerr(fp); if (IoFLAGS(io) & IOf_ARGV) { - fp = nextargv(PL_last_in_gv); + fp = nextargv(PL_last_in_gv, PL_op->op_flags & OPf_SPECIAL); if (fp) continue; (void)do_close(PL_last_in_gv, FALSE); |