In perl.git, the branch blead has been updated <http://perl5.git.perl.org/perl.git/commitdiff/d955f84cfebcbed74088977f0bc7b1162c00a426?hp=91fc0422e3a3e3aa6b0c35bb1d4d18d03fd35f30>
- Log ----------------------------------------------------------------- commit d955f84cfebcbed74088977f0bc7b1162c00a426 Author: Father Chrysostomos <[email protected]> Date: Sun Dec 29 17:11:24 2013 -0800 Improve rcatline bad fh warnings This is not helpful: append I/O operator() on closed filehandle STDIN at - line 3. append I/O operator() on closed filehandle STDIN at - line 4. (Are you trying to call append I/O operator() on dirhandle STDIN?) That .=<> compiles to a separate op from <> is an implementation detail, so show âreadline()â as we do with <>. ----------------------------------------------------------------------- Summary of changes: t/lib/warnings/pp_hot | 13 +++++++++++++ util.c | 3 ++- 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/t/lib/warnings/pp_hot b/t/lib/warnings/pp_hot index ad63d2a..4e63073 100644 --- a/t/lib/warnings/pp_hot +++ b/t/lib/warnings/pp_hot @@ -210,6 +210,19 @@ readline() on closed filehandle STDIN at - line 4. (Are you trying to call readline() on dirhandle STDIN?) ######## # pp_hot.c [Perl_do_readline] +use warnings 'closed' ; +close STDIN ; $a .= <STDIN> ; +opendir STDIN, "." ; $a .= <STDIN> ; +closedir STDIN; +no warnings 'closed' ; +opendir STDIN, "." ; $a .= <STDIN> ; +$a = <STDIN> ; +EXPECT +readline() on closed filehandle STDIN at - line 3. +readline() on closed filehandle STDIN at - line 4. + (Are you trying to call readline() on dirhandle STDIN?) +######## +# pp_hot.c [Perl_do_readline] use warnings 'io' ; my $file = "./xcv" ; unlink $file ; open (FH, ">$file") or die $! ; diff --git a/util.c b/util.c index 55fc941..596955b 100644 --- a/util.c +++ b/util.c @@ -3403,7 +3403,8 @@ Perl_report_evil_fh(pTHX_ const GV *gv) (const char *)(OP_IS_FILETEST(op) ? "" : "()"); const char * const func = (const char *) - (op == OP_READLINE ? "readline" : /* "<HANDLE>" not nice */ + (op == OP_READLINE || op == OP_RCATLINE + ? "readline" : /* "<HANDLE>" not nice */ op == OP_LEAVEWRITE ? "write" : /* "write exit" not nice */ PL_op_desc[op]); const char * const type = -- Perl5 Master Repository
