perlhack.pod addendum for consideration (perlbug mail interface)
[p5sagit/p5-mst-13.2.git] / perl.c
diff --git a/perl.c b/perl.c
index 5f07bfc..7192122 100644 (file)
--- a/perl.c
+++ b/perl.c
@@ -258,7 +258,7 @@ perl_construct(pTHXx)
     sys_intern_init();
 #endif
 
-    PerlIO_init();                     /* Hook to IO system */
+    PerlIO_init(aTHX);                 /* Hook to IO system */
 
     PL_fdpid = newAV();                        /* for remembering popen pids by fd */
     PL_modglobal = newHV();            /* pointers to per-interpreter module globals */
@@ -459,6 +459,11 @@ perl_destruct(pTHXx)
 
        DEBUG_P(debprofdump());
 
+#if defined(PERLIO_LAYERS)
+       /* No more IO - including error messages ! */
+       PerlIO_cleanup(aTHX);
+#endif
+
        /* The exit() function will do everything that needs doing. */
         return STATUS_NATIVE_EXPORT;;
     }
@@ -498,7 +503,7 @@ perl_destruct(pTHXx)
                  * flag is set in regexec.c:S_regtry
                  */
                 SvFLAGS(resv) &= ~SVf_BREAK;
-            } 
+            }
            else if(SvREPADTMP(resv)) {
              SvREPADTMP_off(resv);
            }
@@ -659,6 +664,7 @@ perl_destruct(pTHXx)
     SvREFCNT_dec(PL_utf8_xdigit);
     SvREFCNT_dec(PL_utf8_mark);
     SvREFCNT_dec(PL_utf8_toupper);
+    SvREFCNT_dec(PL_utf8_totitle);
     SvREFCNT_dec(PL_utf8_tolower);
     PL_utf8_alnum      = Nullsv;
     PL_utf8_alnumc     = Nullsv;
@@ -799,6 +805,11 @@ perl_destruct(pTHXx)
     if (PL_sv_count != 0 && ckWARN_d(WARN_INTERNAL))
        Perl_warner(aTHX_ WARN_INTERNAL,"Scalars leaked: %ld\n", (long)PL_sv_count);
 
+#if defined(PERLIO_LAYERS)
+    /* No more IO - including error messages ! */
+    PerlIO_cleanup(aTHX);
+#endif
+
     Safefree(PL_origfilename);
     Safefree(PL_reg_start_tmp);
     if (PL_reg_curpm)
@@ -882,13 +893,6 @@ perl_free(pTHXx)
 #    else
     void *host = w32_internal_host;
 #    endif
-#    ifndef NETWARE
-    if (PerlProc_lasthost()) {
-#      ifdef USE_PERLIO
-       PerlIO_cleanup();
-#      endif
-    }
-#    endif
     PerlMem_free(aTHXx);
 #    ifdef NETWARE
     nw5_delete_internal_host(host);
@@ -896,9 +900,6 @@ perl_free(pTHXx)
     win32_delete_internal_host(host);
 #    endif
 #  else
-#    ifdef USE_PERLIO
-    PerlIO_cleanup();
-#    endif
     PerlMem_free(aTHXx);
 #  endif
 #else
@@ -945,7 +946,7 @@ setuid perl scripts securely.\n");
     {
         /* we copy rather than point to argv
          * since perl_clone will copy and perl_destruct
-         * has no way of knowing if we've made a copy or 
+         * has no way of knowing if we've made a copy or
          * just point to argv
          */
         int i = PL_origargc;
@@ -1491,6 +1492,9 @@ perl_run(pTHXx)
 #endif
 
     oldscope = PL_scopestack_ix;
+#ifdef VMS
+    VMSISH_HUSHED = 0;
+#endif
 
 #ifdef PERL_FLEXIBLE_EXCEPTIONS
  redo_body:
@@ -1513,7 +1517,7 @@ perl_run(pTHXx)
            LEAVE;
        FREETMPS;
        PL_curstash = PL_defstash;
-       if (!(PL_exit_flags & PERL_EXIT_DESTRUCT_END) && 
+       if (!(PL_exit_flags & PERL_EXIT_DESTRUCT_END) &&
            PL_endav && !PL_minus_c)
            call_list(oldscope, PL_endav);
 #ifdef MYMALLOC
@@ -1562,7 +1566,7 @@ S_run_body(pTHX_ I32 oldscope)
 
        if (PL_minus_c) {
 #ifdef MACOS_TRADITIONAL
-           PerlIO_printf(Perl_error_log, "%s syntax OK\n", MacPerl_MPWFileName(PL_origfilename));
+           PerlIO_printf(Perl_error_log, "# %s syntax OK\n", MacPerl_MPWFileName(PL_origfilename));
 #else
            PerlIO_printf(Perl_error_log, "%s syntax OK\n", PL_origfilename);
 #endif
@@ -2409,7 +2413,8 @@ Perl_moreswitches(pTHX_ char *s)
                      "\n\nCopyright 1987-2001, Larry Wall\n");
 #ifdef MACOS_TRADITIONAL
        PerlIO_printf(PerlIO_stdout(),
-                     "\nMac OS port Copyright (c) 1991-2001, Matthias Neeracher\n");
+                     "\nMac OS port Copyright 1991-2001, Matthias Neeracher;\n"
+                     "maintained by Chris Nandor\n");
 #endif
 #ifdef MSDOS
        PerlIO_printf(PerlIO_stdout(),