diff options
-rw-r--r-- | util.c | 16 |
1 files changed, 8 insertions, 8 deletions
@@ -3893,20 +3893,14 @@ Perl_report_evil_fh(pTHX_ GV *gv, IO *io, I32 op) char *vile; I32 warn; char *func = - op == OP_READLINE ? "readline" : - op == OP_LEAVEWRITE ? "write" : + op == OP_READLINE ? "readline" : /* "<HANDLE>" not nice */ + op == OP_LEAVEWRITE ? "write" : /* "write exit" not nice */ PL_op_desc[op]; char *pars = OP_IS_FILETEST(op) ? "" : "()"; char *type = OP_IS_SOCKET(op) || (io && IoTYPE(io) == IoTYPE_SOCKET) ? "socket" : "filehandle"; char *name = NULL; - if (isGV(gv)) { - SV *sv = sv_newmortal(); - gv_efullname4(sv, gv, Nullch, FALSE); - name = SvPVX(sv); - } - if (io && IoTYPE(io) == IoTYPE_CLOSED) { vile = "closed"; warn = WARN_CLOSED; @@ -3916,6 +3910,12 @@ Perl_report_evil_fh(pTHX_ GV *gv, IO *io, I32 op) warn = WARN_UNOPENED; } + if (gv && isGV(gv)) { + SV *sv = sv_newmortal(); + gv_efullname4(sv, gv, Nullch, FALSE); + name = SvPVX(sv); + } + if (name && *name) { Perl_warner(aTHX_ warn, "%s%s on %s %s %s", func, pars, vile, type, name); |