This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Spread the good word of "env".
[perl5.git] / doio.c
diff --git a/doio.c b/doio.c
index 2577b2f..be27b93 100644 (file)
--- a/doio.c
+++ b/doio.c
@@ -951,21 +951,7 @@ Perl_do_eof(pTHX_ GV *gv)
     if (!io)
        return TRUE;
     else if (ckWARN(WARN_IO) && (IoTYPE(io) == IoTYPE_WRONLY))
-    {
-       /* integrate to report_evil_fh()? */
-        char *name = NULL;
-       if (isGV(gv)) {
-           SV* sv = sv_newmortal();
-           gv_efullname4(sv, gv, Nullch, FALSE);
-           name = SvPV_nolen(sv);
-       }
-       if (name && *name)
-           Perl_warner(aTHX_ WARN_IO,
-                       "Filehandle %s opened only for output", name);
-       else
-           Perl_warner(aTHX_ WARN_IO,
-                       "Filehandle opened only for output");
-    }
+       report_evil_fh(gv, io, OP_phoney_OUTPUT_ONLY);
 
     while (IoIFP(io)) {
 
@@ -1108,8 +1094,8 @@ Perl_do_binmode(pTHX_ PerlIO *fp, int iotype, int mode)
   * This is a stub for any XS code which might have been calling it.
   */
  char *name = ":raw";
-#ifdef PERLIO_CRLF
- if (!(mode & O_BINARY)))
+#ifdef PERLIO_USING_CRLF
+ if (!(mode & O_BINARY))
      name = ":crlf";
 #endif
  return PerlIO_binmode(aTHX_ fp, iotype, mode, name);
@@ -2120,6 +2106,8 @@ Perl_do_shmio(pTHX_ I32 optype, SV **mark, SV **sp)
 #endif /* SYSV IPC */
 
 /*
+=head1 IO Functions
+
 =for apidoc start_glob
 
 Function called by C<do_readline> to spawn a glob (or do the glob inside