diff options
Diffstat (limited to 'doio.c')
-rw-r--r-- | doio.c | 15 |
1 files changed, 12 insertions, 3 deletions
@@ -585,9 +585,18 @@ Perl_nextargv(pTHX_ register GV *gv) } return IoIFP(GvIOp(gv)); } - else - PerlIO_printf(PerlIO_stderr(), "Can't open %s: %s\n", - SvPV(sv, oldlen), Strerror(errno)); + else { + dTHR; + if (ckWARN_d(WARN_INPLACE)) { + if (!S_ISREG(PL_statbuf.st_mode)) + Perl_warner(aTHX_ WARN_INPLACE, + "Can't do inplace edit: %s is not a regular file", + PL_oldname ); + else + Perl_warner(aTHX_ WARN_INPLACE, "Can't open %s: %s\n", + PL_oldname, Strerror(errno)); + } + } } if (PL_inplace) { (void)do_close(PL_argvoutgv,FALSE); |