integrate cfgperl contents
Gurusamy Sarathy [Wed, 24 Feb 1999 07:02:12 +0000 (07:02 +0000)]
p4raw-id: //depot/perl@3023

47 files changed:
MANIFEST
cop.h
cv.h
doio.c
ext/Data/Dumper/Dumper.xs
ext/DynaLoader/dl_beos.xs
ext/DynaLoader/dl_cygwin32.xs
ext/GDBM_File/GDBM_File.pm
ext/GDBM_File/GDBM_File.xs
ext/GDBM_File/typemap
ext/IO/poll.h
ext/SDBM_File/sdbm/sdbm.h
iperlsys.h
lib/ExtUtils/MM_Unix.pm
lib/Fatal.pm
lib/Pod/Functions.pm
lib/dotsh.pl
malloc.c
op.c
perl.h
perlio.c
perly.c
perly.h
perly.y
pod/perldelta.pod
pod/perlfunc.pod
pod/perlop.pod
pod/perlsub.pod
pod/perltodo.pod
pp_ctl.c
pp_hot.c
regcomp.c
regexec.c
sv.c
t/comp/proto.t
t/lib/bigfloatpm.t
t/lib/fatal.t [new file with mode: 0755]
t/lib/io_sock.t
t/op/filetest.t [changed mode: 0644->0755]
t/op/lex_assign.t
t/op/misc.t
t/op/pat.t
t/op/subst_amp.t [changed mode: 0644->0755]
utils/h2xs.PL
utils/perldoc.PL
vms/perly_c.vms
win32/win32.c

index f89e2c7..c38dae9 100644 (file)
--- a/MANIFEST
+++ b/MANIFEST
@@ -1072,6 +1072,7 @@ t/lib/dumper.t            See if Data::Dumper works
 t/lib/english.t                See if English works
 t/lib/env.t            See if Env works
 t/lib/errno.t          See if Errno works
+t/lib/fatal.t           See if Fatal works
 t/lib/fields.t          See if base/fields works
 t/lib/filecache.t      See if FileCache works
 t/lib/filecopy.t       See if File::Copy works
diff --git a/cop.h b/cop.h
index 6bdb594..aa5b6d5 100644 (file)
--- a/cop.h
+++ b/cop.h
@@ -181,17 +181,17 @@ struct block {
        cx->cx_type             = t,                                    \
        cx->blk_oldsp           = sp - PL_stack_base,                   \
        cx->blk_oldcop          = PL_curcop,                            \
-       cx->blk_oldmarksp       = PL_markstack_ptr - PL_markstack,              \
+       cx->blk_oldmarksp       = PL_markstack_ptr - PL_markstack,      \
        cx->blk_oldscopesp      = PL_scopestack_ix,                     \
-       cx->blk_oldretsp        = PL_retstack_ix,                               \
+       cx->blk_oldretsp        = PL_retstack_ix,                       \
        cx->blk_oldpm           = PL_curpm,                             \
        cx->blk_gimme           = gimme;                                \
        DEBUG_l( PerlIO_printf(PerlIO_stderr(), "Entering block %ld, type %s\n",        \
-                   (long)cxstack_ix, PL_block_type[t]); )
+                   (long)cxstack_ix, PL_block_type[CxTYPE(cx)]); )
 
 /* Exit a block (RETURN and LAST). */
 #define POPBLOCK(cx,pm) cx = &cxstack[cxstack_ix--],                   \
-       newsp            = PL_stack_base + cx->blk_oldsp,                       \
+       newsp            = PL_stack_base + cx->blk_oldsp,               \
        PL_curcop        = cx->blk_oldcop,                              \
        PL_markstack_ptr = PL_markstack + cx->blk_oldmarksp,            \
        PL_scopestack_ix = cx->blk_oldscopesp,                          \
@@ -203,7 +203,7 @@ struct block {
 
 /* Continue a block elsewhere (NEXT and REDO). */
 #define TOPBLOCK(cx) cx  = &cxstack[cxstack_ix],                       \
-       PL_stack_sp      = PL_stack_base + cx->blk_oldsp,                       \
+       PL_stack_sp      = PL_stack_base + cx->blk_oldsp,               \
        PL_markstack_ptr = PL_markstack + cx->blk_oldmarksp,            \
        PL_scopestack_ix = cx->blk_oldscopesp,                          \
        PL_retstack_ix   = cx->blk_oldretsp,                            \
diff --git a/cv.h b/cv.h
index c7c7a73..0d31a44 100644 (file)
--- a/cv.h
+++ b/cv.h
@@ -94,3 +94,12 @@ struct xpvcv {
 #define CvLOCKED(cv)           (CvFLAGS(cv) & CVf_LOCKED)
 #define CvLOCKED_on(cv)                (CvFLAGS(cv) |= CVf_LOCKED)
 #define CvLOCKED_off(cv)       (CvFLAGS(cv) &= ~CVf_LOCKED)
+
+#define CvEVAL(cv)             (CvUNIQUE(cv) && !SvFAKE(cv))
+#define CvEVAL_on(cv)          (CvUNIQUE_on(cv),SvFAKE_off(cv))
+#define CvEVAL_off(cv)         CvUNIQUE_off(cv)
+
+/* BEGIN|INIT|END */
+#define CvSPECIAL(cv)          (CvUNIQUE(cv) && SvFAKE(cv))
+#define CvSPECIAL_on(cv)       (CvUNIQUE_on(cv),SvFAKE_on(cv))
+#define CvSPECIAL_off(cv)      (CvUNIQUE_off(cv),SvFAKE_off(cv))
diff --git a/doio.c b/doio.c
index 79db3aa..3038c3d 100644 (file)
--- a/doio.c
+++ b/doio.c
@@ -1324,18 +1324,18 @@ nothing in the core.
            struct utimbuf utbuf;
 #else
            struct {
-               long    actime;
-               long    modtime;
+               Time_t  actime;
+               Time_t  modtime;
            } utbuf;
 #endif
 
            Zero(&utbuf, sizeof utbuf, char);
 #ifdef BIG_TIME
-           utbuf.actime = (Time_t)SvNVx(*++mark);    /* time accessed */
-           utbuf.modtime = (Time_t)SvNVx(*++mark);    /* time modified */
+           utbuf.actime = (Time_t)SvNVx(*++mark);      /* time accessed */
+           utbuf.modtime = (Time_t)SvNVx(*++mark);     /* time modified */
 #else
-           utbuf.actime = SvIVx(*++mark);    /* time accessed */
-           utbuf.modtime = SvIVx(*++mark);    /* time modified */
+           utbuf.actime = (Time_t)SvIVx(*++mark);      /* time accessed */
+           utbuf.modtime = (Time_t)SvIVx(*++mark);     /* time modified */
 #endif
            APPLY_TAINT_PROPER();
            tot = sp - mark;
index ad7c5d4..c9ad9b6 100644 (file)
@@ -4,7 +4,7 @@
 
 #ifndef PERL_VERSION
 #include "patchlevel.h"
-#defined PERL_VERSION PATCHLEVEL
+#define PERL_VERSION PATCHLEVEL
 #endif
 
 #if PERL_VERSION < 5
index 515d187..42a27cb 100644 (file)
@@ -51,7 +51,7 @@ dl_load_file(filename, flags=0)
     ST(0) = sv_newmortal() ;
     if (bogo < 0) {
        SaveError("%s", strerror(bogo));
-       fprintf(stderr, "load_add_on(%s) : %d (%s)\n", path, bogo, strerror(bogo));
+       PerlIO_printf(PerlIO_stderr(), "load_add_on(%s) : %d (%s)\n", path, bogo, strerror(bogo));
     } else {
        RETVAL = (void *) bogo;
        sv_setiv( ST(0), (IV)RETVAL);
@@ -81,7 +81,7 @@ dl_find_symbol(libhandle, symbolname)
     ST(0) = sv_newmortal() ;
     if (RETVAL == NULL) {
        SaveError("%s", strerror(retcode)) ;
-       fprintf(stderr, "retcode = %p (%s)\n", retcode, strerror(retcode));
+       PerlIO_printf(PerlIO_stderr(), "retcode = %p (%s)\n", retcode, strerror(retcode));
     } else
        sv_setiv( ST(0), (IV)RETVAL);
 
index 2b75637..b64ab3e 100644 (file)
@@ -82,11 +82,11 @@ dl_load_file(filename,flags=0)
     int                        flags
     PREINIT:
     CODE:
-    DLDEBUG(1,fprintf(stderr,"dl_load_file(%s):\n", filename));
+    DLDEBUG(1,PerlIO_printf(PerlIO_stderr(),"dl_load_file(%s):\n", filename));
 
     RETVAL = (void*) LoadLibraryExA(filename, NULL, LOAD_WITH_ALTERED_SEARCH_PATH ) ;
 
-    DLDEBUG(2,fprintf(stderr," libref=%x\n", RETVAL));
+    DLDEBUG(2,PerlIO_printf(PerlIO_stderr()," libref=%x\n", RETVAL));
     ST(0) = sv_newmortal() ;
     if (RETVAL == NULL){
        SaveError("%d",GetLastError()) ;
@@ -113,10 +113,10 @@ dl_find_symbol(libhandle, symbolname)
     void *     libhandle
     char *     symbolname
     CODE:
-    DLDEBUG(2,fprintf(stderr,"dl_find_symbol(handle=%x, symbol=%s)\n",
+    DLDEBUG(2,PerlIO_printf(PerlIO_stderr(),"dl_find_symbol(handle=%x, symbol=%s)\n",
        libhandle, symbolname));
     RETVAL = (void*) GetProcAddress((HINSTANCE) libhandle, symbolname);
-    DLDEBUG(2,fprintf(stderr,"  symbolref = %x\n", RETVAL));
+    DLDEBUG(2,PerlIO_printf(PerlIO_stderr(),"  symbolref = %x\n", RETVAL));
     ST(0) = sv_newmortal() ;
     if (RETVAL == NULL)
        SaveError("%d",GetLastError()) ;
@@ -138,7 +138,7 @@ dl_install_xsub(perl_name, symref, filename="$Package")
     void *             symref 
     char *             filename
     CODE:
-    DLDEBUG(2,fprintf(stderr,"dl_install_xsub(name=%s, symref=%x)\n",
+    DLDEBUG(2,PerlIO_printf(PerlIO_stderr(),"dl_install_xsub(name=%s, symref=%x)\n",
                perl_name, symref));
     ST(0)=sv_2mortal(newRV((SV*)newXS(perl_name, (void(*)())symref, filename)));
 
index 09df437..af9a5dc 100644 (file)
@@ -59,7 +59,7 @@ require DynaLoader;
        GDBM_WRITER
 );
 
-$VERSION = "1.00";
+$VERSION = "1.01";
 
 sub AUTOLOAD {
     my($constname);
index ac1ca8c..808850d 100644 (file)
@@ -18,8 +18,6 @@ typedef GDBM_FILE GDBM_File;
 #define gdbm_NEXTKEY(db,key)                   gdbm_nextkey(db,key)
 #define gdbm_EXISTS(db,key)                    gdbm_exists(db,key)
 
-typedef datum gdatum;
-
 typedef void (*FATALFUNC)();
 
 static int
@@ -29,6 +27,21 @@ not_here(char *s)
     return -1;
 }
 
+/* GDBM allocates the datum with system malloc() and expects the user
+ * to free() it.  So we either have to free() it immediately, or have
+ * perl free() it when it deallocates the SV, depending on whether
+ * perl uses malloc()/free() or not. */
+static void
+output_datum(SV *arg, char *str, int size)
+{
+#if !defined(MYMALLOC) || (defined(MYMALLOC) && defined(PERL_POLLUTE_MALLOC))
+       sv_usepvn(arg, str, size);
+#else
+       sv_setpvn(arg, str, size);
+       safesysfree(str);
+#endif
+}
+
 /* Versions of gdbm prior to 1.7x might not have the gdbm_sync,
    gdbm_exists, and gdbm_setopt functions.  Apparently Slackware
    (Linux) 2.1 contains gdbm-1.5 (which dates back to 1991).
@@ -186,7 +199,7 @@ gdbm_DESTROY(db)
        CODE:
        gdbm_close(db);
 
-gdatum
+datum
 gdbm_FETCH(db, key)
        GDBM_File       db
        datum           key
@@ -211,11 +224,11 @@ gdbm_DELETE(db, key)
        GDBM_File       db
        datum           key
 
-gdatum
+datum
 gdbm_FIRSTKEY(db)
        GDBM_File       db
 
-gdatum
+datum
 gdbm_NEXTKEY(db, key)
        GDBM_File       db
        datum           key
index 317a8f3..d122d07 100644 (file)
@@ -3,7 +3,6 @@
 #
 
 datum                  T_DATUM
-gdatum                 T_GDATUM
 NDBM_File              T_PTROBJ
 GDBM_File              T_PTROBJ
 SDBM_File              T_PTROBJ
@@ -16,12 +15,8 @@ INPUT
 T_DATUM
        $var.dptr = SvPV($arg, PL_na);
        $var.dsize = (int)PL_na;
-T_GDATUM
-       UNIMPLEMENTED
 OUTPUT
 T_DATUM
-       sv_setpvn($arg, $var.dptr, $var.dsize);
-T_GDATUM
-       sv_usepvn($arg, $var.dptr, $var.dsize);
+       output_datum($arg, $var.dptr, $var.dsize);
 T_PTROBJ
         sv_setref_pv($arg, dbtype, (void*)$var);
index d17edff..c5cdd7f 100644 (file)
 #ifndef POLL_H
 #  define POLL_H
 
-#if defined(I_POLL) || defined(POLLWRBAND)
+#if (defined(HAS_POLL) && defined(I_POLL)) || defined(POLLWRBAND)
 #  include <poll.h>
-#  ifndef HAS_POLL
-#    define HAS_POLL
-#  endif
 #else
 #ifdef HAS_SELECT
 
index 4921de7..4dc1a22 100644 (file)
@@ -168,8 +168,7 @@ extern long sdbm_hash proto((char *, int));
 /* This comes after <stdlib.h> so we don't try to change the standard
  * library prototypes; we'll use our own instead. */
 
-#if defined(MYMALLOC)
-
+#if defined(MYMALLOC) && !defined(PERL_POLLUTE_MALLOC)
 #  define malloc  Perl_malloc
 #  define calloc  Perl_calloc
 #  define realloc Perl_realloc
@@ -179,7 +178,6 @@ Malloc_t Perl_malloc proto((MEM_SIZE nbytes));
 Malloc_t Perl_calloc proto((MEM_SIZE elements, MEM_SIZE size));
 Malloc_t Perl_realloc proto((Malloc_t where, MEM_SIZE nbytes));
 Free_t   Perl_mfree proto((Malloc_t where));
-
 #endif /* MYMALLOC */
 
 #ifdef I_STRING
index cfdc39f..67ef90a 100644 (file)
@@ -114,7 +114,7 @@ public:
     virtual int                Printf(PerlIO*, int &err, const char *,...) = 0;
     virtual int                Vprintf(PerlIO*, int &err, const char *, va_list) = 0;
     virtual long       Tell(PerlIO*, int &err) = 0;
-    virtual int                Seek(PerlIO*, off_t, int, int &err) = 0;
+    virtual int                Seek(PerlIO*, Off_t, int, int &err) = 0;
     virtual void       Rewind(PerlIO*, int &err) = 0;
     virtual PerlIO *   Tmpfile(int &err) = 0;
     virtual int                Getpos(PerlIO*, Fpos_t *, int &err) = 0;
@@ -322,10 +322,10 @@ extern int        PerlIO_sprintf          _((char *, int, const char *,...))
 extern int     PerlIO_vprintf          _((PerlIO *, const char *, va_list));
 #endif
 #ifndef PerlIO_tell
-extern long    PerlIO_tell             _((PerlIO *));
+extern Off_t   PerlIO_tell             _((PerlIO *));
 #endif
 #ifndef PerlIO_seek
-extern int     PerlIO_seek             _((PerlIO *,off_t,int));
+extern int     PerlIO_seek             _((PerlIO *, Off_t, int));
 #endif
 #ifndef PerlIO_rewind
 extern void    PerlIO_rewind           _((PerlIO *));
index 60f03d8..38bb061 100644 (file)
@@ -8,7 +8,7 @@ use strict;
 use vars qw($VERSION $Is_Mac $Is_OS2 $Is_VMS $Is_Win32 $Is_Dos $Is_PERL_OBJECT
            $Verbose %pm %static $Xsubpp_Version);
 
-$VERSION = substr q$Revision: 1.12601 $, 10;
+$VERSION = substr q$Revision: 1.12602 $, 10;
 # $Id: MM_Unix.pm,v 1.126 1998/06/28 21:32:49 k Exp k $
 
 Exporter::import('ExtUtils::MakeMaker',
@@ -2350,7 +2350,7 @@ $tmp/perlmain\$(OBJ_EXT): $tmp/perlmain.c
 $tmp/perlmain.c: $makefilename}, q{
        }.$self->{NOECHO}.q{echo Writing $@
        }.$self->{NOECHO}.q{$(PERL) $(MAP_PERLINC) -MExtUtils::Miniperl \\
-               -e "writemain(grep s#.*/auto/##, qw|$(MAP_STATIC)|)" > $@t && $(MV) $@t $@
+               -e "writemain(grep s#.*/auto/##, split(q| |, q|$(MAP_STATIC)|))" > $@t && $(MV) $@t $@
 
 };
     push @m, "\t",$self->{NOECHO}.q{$(PERL) $(INSTALLSCRIPT)/fixpmain
index a1e5cff..d1d95af 100644 (file)
@@ -111,11 +111,13 @@ EOS
     $code .= write_invocation($core, $call, $name, @protos);
     $code .= "}\n";
     print $code if $Debug;
-    $code = eval($code);
-    die if $@;
-    local($^W) = 0;   # to avoid: Subroutine foo redefined ...
-    no strict 'refs'; # to avoid: Can't use string (...) as a symbol ref ...
-    *{$sub} = $code;
+    {
+      no strict 'refs'; # to avoid: Can't use string (...) as a symbol ref ...
+      $code = eval("package $pkg; use Carp; $code");
+      die if $@;
+      local($^W) = 0;   # to avoid: Subroutine foo redefined ...
+      *{$sub} = $code;
+    }
 }
 
 1;
index 3cc9b38..033c579 100644 (file)
@@ -210,9 +210,11 @@ qq/STRING/ String  doubly quote a string
 quotemeta      Regexp  quote regular expression magic characters
 qw/STRING/     LIST    quote a list of words
 qx/STRING/     Process backquote quote a string
+qr/PATTERN/    Regexp  Compile pattern 
 rand   Math    retrieve the next pseudorandom number 
 read   I/O,Binary      fixed-length buffered input from a filehandle
 readdir        I/O     get a directory from a directory handle
+readline       I/O     fetch a record from a file
 readlink       File    determine where a symbolic link is pointing
 recv   Socket  receive a message over a Socket
 redo   Flow    start this loop iteration over again
@@ -266,6 +268,7 @@ substr      String  get or alter a portion of a stirng
 symlink        File    create a symbolic link to a file
 syscall        I/O,Binary      execute an arbitrary system call
 sysread        I/O,Binary      fixed-length unbuffered input from a filehandle
+sysseek        I/O,Binary      position I/O pointer on handle used with sysread and syswrite
 system Process run a separate program 
 syswrite       I/O,Binary      fixed-length unbuffered output to a filehandle
 tell   I/O     get current seekpointer on a filehandle
index 877467e..4982b17 100644 (file)
@@ -26,7 +26,9 @@
 #
 sub dotsh {
    local(@sh) = @_;
-   local($tmp,$key,$shell,*dotsh,$command,$args,$vars) = '';
+   local($tmp,$key,$shell,$command,$args,$vars) = '';
+   local(*dotsh);
+   undef *dotsh;
    $dotsh = shift(@sh);
    @dotsh = split (/\s/, $dotsh);
    $command = shift (@dotsh);
@@ -37,7 +39,7 @@ sub dotsh {
    $shell = "$1 -c" if ($_ =~ /^\#\!\s*(\S+(\/sh|\/ksh|\/zsh|\/csh))\s*$/);
    close (_SH_ENV);
    if (!$shell) {
-      if ($ENV{'SHELL'} =~ /\/sh$|\/ksh$|\/zsh$|\/csh$/) {
+      if ($ENV{'SHELL'} =~ /\/sh$|\/ksh$|\/zsh$|\/bash$|\/csh$/) {
         $shell = "$ENV{'SHELL'} -c";
       } else {
         print "SHELL not recognized!\nUsing /bin/sh...\n";
index fd3b05b..2716045 100644 (file)
--- a/malloc.c
+++ b/malloc.c
@@ -1793,7 +1793,7 @@ Perl_sbrk(int size)
 #  endif
       got = (IV)SYSTEM_ALLOC(size);
 #  if NEEDED_ALIGNMENT > SYSTEM_ALLOC_ALIGNMENT
-      got = (got + NEEDED_ALIGNMENT - 1) & (NEEDED_ALIGNMENT - 1);
+      got = (got + NEEDED_ALIGNMENT - 1) & ~(NEEDED_ALIGNMENT - 1);
 #  endif
       if (small) {
        /* Chunk is small, register the rest for future allocs. */
diff --git a/op.c b/op.c
index 51df803..279fae8 100644 (file)
--- a/op.c
+++ b/op.c
@@ -358,8 +358,8 @@ pad_findmy(char *name)
     /* Check if if we're compiling an eval'', and adjust seq to be the
      * eval's seq number.  This depends on eval'' having a non-null
      * CvOUTSIDE() while it is being compiled.  The eval'' itself is
-     * identified by CvUNIQUE being set and CvGV being null. */
-    if (outside && CvUNIQUE(PL_compcv) && !CvGV(PL_compcv) && cxstack_ix >= 0) {
+     * identified by CvEVAL being true and CvGV being null. */
+    if (outside && CvEVAL(PL_compcv) && !CvGV(PL_compcv) && cxstack_ix >= 0) {
        cx = &cxstack[cxstack_ix];
        if (CxREALEVAL(cx))
            seq = cx->blk_oldcop->cop_seq;
@@ -5303,19 +5303,13 @@ ck_subr(OP *o)
                    bad_type(arg, "block", gv_ename(namegv), o2);
                break;
            case '*':
+               /* '*' allows any scalar type, including bareword */
                proto++;
                arg++;
                if (o2->op_type == OP_RV2GV)
-                   goto wrapref;
-               {
-                   OP* kid = o2;
-                   OP* sib = kid->op_sibling;
-                   kid->op_sibling = 0;
-                   o2 = newUNOP(OP_RV2GV, 0, kid);
-                   o2->op_sibling = sib;
-                   prev->op_sibling = o2;
-               }
-               goto wrapref;
+                   goto wrapref;       /* autoconvert GLOB -> GLOBref */
+               scalar(o2);
+               break;
            case '\\':
                proto++;
                arg++;
diff --git a/perl.h b/perl.h
index 0accd02..af64d64 100644 (file)
--- a/perl.h
+++ b/perl.h
@@ -1380,7 +1380,7 @@ typedef I32 (*filter_t) _((int, SV *, int));
 #      else
 #        ifdef I_MACH_CTHREADS
 #          include <mach/cthreads.h>
-#          ifdef NeXT
+#          if defined(__NeXT__) && defined(PERL_POLLUTE_MALLOC)
 #            define MUTEX_INIT_CALLS_MALLOC
 #          endif
 typedef cthread_t      perl_os_thread;
index a1af870..5655792 100644 (file)
--- a/perlio.c
+++ b/perlio.c
@@ -55,13 +55,13 @@ PerlIO_tmpfile(void)
 
 #undef PerlIO_tmpfile
 PerlIO *
-PerlIO_tmpfile()
+PerlIO_tmpfile(void)
 {
  return sftmp(0);
 }
 
 void
-PerlIO_init()
+PerlIO_init(void)
 {
  /* Force this file to be included  in perl binary. Which allows 
   *  this file to force inclusion  of other functions that may be 
@@ -84,29 +84,28 @@ PerlIO_init()
 
 #undef PerlIO_stderr
 PerlIO *
-PerlIO_stderr()
+PerlIO_stderr(void)
 {
  return (PerlIO *) stderr;
 }
 
 #undef PerlIO_stdin
 PerlIO *
-PerlIO_stdin()
+PerlIO_stdin(void)
 {
  return (PerlIO *) stdin;
 }
 
 #undef PerlIO_stdout
 PerlIO *
-PerlIO_stdout()
+PerlIO_stdout(void)
 {
  return (PerlIO *) stdout;
 }
 
 #undef PerlIO_fast_gets
 int 
-PerlIO_fast_gets(f)
-PerlIO *f;
+PerlIO_fast_gets(PerlIO *f)
 {
 #if defined(USE_STDIO_PTR) && defined(STDIO_PTR_LVALUE) && defined(STDIO_CNT_LVALUE)
  return 1;
@@ -117,8 +116,7 @@ PerlIO *f;
 
 #undef PerlIO_has_cntptr
 int 
-PerlIO_has_cntptr(f)
-PerlIO *f;
+PerlIO_has_cntptr(PerlIO *f)
 {
 #if defined(USE_STDIO_PTR)
  return 1;
@@ -129,8 +127,7 @@ PerlIO *f;
 
 #undef PerlIO_canset_cnt
 int 
-PerlIO_canset_cnt(f)
-PerlIO *f;
+PerlIO_canset_cnt(PerlIO *f)
 {
 #if defined(USE_STDIO_PTR) && defined(STDIO_CNT_LVALUE)
  return 1;
@@ -141,9 +138,7 @@ PerlIO *f;
 
 #undef PerlIO_set_cnt
 void
-PerlIO_set_cnt(f,cnt)
-PerlIO *f;
-int cnt;
+PerlIO_set_cnt(PerlIO *f, int cnt)
 {
  if (cnt < -1)
   warn("Setting cnt to %d\n",cnt);
@@ -156,10 +151,7 @@ int cnt;
 
 #undef PerlIO_set_ptrcnt
 void
-PerlIO_set_ptrcnt(f,ptr,cnt)
-PerlIO *f;
-STDCHAR *ptr;
-int cnt;
+PerlIO_set_ptrcnt(PerlIO *f, STDCHAR *ptr, int cnt)
 {
 #ifdef FILE_bufsiz
  STDCHAR *e = FILE_base(f) + FILE_bufsiz(f);
@@ -183,8 +175,7 @@ int cnt;
 
 #undef PerlIO_get_cnt
 int 
-PerlIO_get_cnt(f)
-PerlIO *f;
+PerlIO_get_cnt(PerlIO *f)
 {
 #ifdef FILE_cnt
  return FILE_cnt(f);
@@ -196,8 +187,7 @@ PerlIO *f;
 
 #undef PerlIO_get_bufsiz
 int 
-PerlIO_get_bufsiz(f)
-PerlIO *f;
+PerlIO_get_bufsiz(PerlIO *f)
 {
 #ifdef FILE_bufsiz
  return FILE_bufsiz(f);
@@ -209,8 +199,7 @@ PerlIO *f;
 
 #undef PerlIO_get_ptr
 STDCHAR *
-PerlIO_get_ptr(f)
-PerlIO *f;
+PerlIO_get_ptr(PerlIO *f)
 {
 #ifdef FILE_ptr
  return FILE_ptr(f);
@@ -222,8 +211,7 @@ PerlIO *f;
 
 #undef PerlIO_get_base
 STDCHAR *
-PerlIO_get_base(f)
-PerlIO *f;
+PerlIO_get_base(PerlIO *f)
 {
 #ifdef FILE_base
  return FILE_base(f);
@@ -235,8 +223,7 @@ PerlIO *f;
 
 #undef PerlIO_has_base 
 int 
-PerlIO_has_base(f)
-PerlIO *f;
+PerlIO_has_base(PerlIO *f)
 {
 #ifdef FILE_base
  return 1;
@@ -247,62 +234,49 @@ PerlIO *f;
 
 #undef PerlIO_puts
 int
-PerlIO_puts(f,s)
-PerlIO *f;
-const char *s;
+PerlIO_puts(PerlIO *f, const char *s)
 {
  return fputs(s,f);
 }
 
 #undef PerlIO_open 
 PerlIO * 
-PerlIO_open(path,mode)
-const char *path;
-const char *mode;
+PerlIO_open(const char *path, const char *mode)
 {
  return fopen(path,mode);
 }
 
 #undef PerlIO_fdopen
 PerlIO * 
-PerlIO_fdopen(fd,mode)
-int fd;
-const char *mode;
+PerlIO_fdopen(int fd, const char *mode)
 {
  return fdopen(fd,mode);
 }
 
 #undef PerlIO_reopen
 PerlIO * 
-PerlIO_reopen(name, mode, f)
-const char *name;
-const char *mode;
-PerlIO *f;
+PerlIO_reopen(const char *name, const char *mode, PerlIO *f)
 {
  return freopen(name,mode,f);
 }
 
 #undef PerlIO_close
 int      
-PerlIO_close(f)
-PerlIO *f;
+PerlIO_close(PerlIO *f)
 {
  return fclose(f);
 }
 
 #undef PerlIO_eof
 int      
-PerlIO_eof(f)
-PerlIO *f;
+PerlIO_eof(PerlIO *f)
 {
  return feof(f);
 }
 
 #undef PerlIO_getname
 char *
-PerlIO_getname(f,buf)
-PerlIO *f;
-char *buf;
+PerlIO_getname(PerlIO *f, char *buf)
 {
 #ifdef VMS
  return fgetname(f,buf);
@@ -314,48 +288,42 @@ char *buf;
 
 #undef PerlIO_getc
 int      
-PerlIO_getc(f)
-PerlIO *f;
+PerlIO_getc(PerlIO *f)
 {
  return fgetc(f);
 }
 
 #undef PerlIO_error
 int      
-PerlIO_error(f)
-PerlIO *f;
+PerlIO_error(PerlIO *f)
 {
  return ferror(f);
 }
 
 #undef PerlIO_clearerr
 void
-PerlIO_clearerr(f)
-PerlIO *f;
+PerlIO_clearerr(PerlIO *f)
 {
  clearerr(f);
 }
 
 #undef PerlIO_flush
 int      
-PerlIO_flush(f)
-PerlIO *f;
+PerlIO_flush(PerlIO *f)
 {
  return Fflush(f);
 }
 
 #undef PerlIO_fileno
 int      
-PerlIO_fileno(f)
-PerlIO *f;
+PerlIO_fileno(PerlIO *f)
 {
  return fileno(f);
 }
 
 #undef PerlIO_setlinebuf
 void
-PerlIO_setlinebuf(f)
-PerlIO *f;
+PerlIO_setlinebuf(PerlIO *f)
 {
 #ifdef HAS_SETLINEBUF
     setlinebuf(f);
@@ -370,56 +338,42 @@ PerlIO *f;
 
 #undef PerlIO_putc
 int      
-PerlIO_putc(f,ch)
-PerlIO *f;
-int ch;
+PerlIO_putc(PerlIO *f, int ch)
 {
  return putc(ch,f);
 }
 
 #undef PerlIO_ungetc
 int      
-PerlIO_ungetc(f,ch)
-PerlIO *f;
-int ch;
+PerlIO_ungetc(PerlIO *f, int ch)
 {
  return ungetc(ch,f);
 }
 
 #undef PerlIO_read
 SSize_t
-PerlIO_read(f,buf,count)
-PerlIO *f;
-void *buf;
-Size_t count;
+PerlIO_read(PerlIO *f, void *buf, Size_t count)
 {
  return fread(buf,1,count,f);
 }
 
 #undef PerlIO_write
 SSize_t
-PerlIO_write(f,buf,count)
-PerlIO *f;
-const void *buf;
-Size_t count;
+PerlIO_write(PerlIO *f, const void *buf, Size_t count)
 {
  return fwrite1(buf,1,count,f);
 }
 
 #undef PerlIO_vprintf
 int      
-PerlIO_vprintf(f,fmt,ap)
-PerlIO *f;
-const char *fmt;
-va_list ap;
+PerlIO_vprintf(PerlIO *f, const char *fmt, va_list ap)
 {
  return vfprintf(f,fmt,ap);
 }
 
 #undef PerlIO_tell
 Off_t
-PerlIO_tell(f)
-PerlIO *f;
+PerlIO_tell(PerlIO *f)
 {
 #ifdef HAS_FTELLO
  return ftello(f);
@@ -430,10 +384,7 @@ PerlIO *f;
 
 #undef PerlIO_seek
 int
-PerlIO_seek(f,offset,whence)
-PerlIO *f;
-Off_t offset;
-int whence;
+PerlIO_seek(PerlIO *f, Off_t offset, int whence)
 {
 #ifdef HAS_FSEEKO
  return fseeko(f,offset,whence);
@@ -444,8 +395,7 @@ int whence;
 
 #undef PerlIO_rewind
 void
-PerlIO_rewind(f)
-PerlIO *f;
+PerlIO_rewind(PerlIO *f)
 {
  rewind(f);
 }
@@ -476,47 +426,40 @@ PerlIO_stdoutf(const char *fmt,...)
 
 #undef PerlIO_tmpfile
 PerlIO *
-PerlIO_tmpfile()
+PerlIO_tmpfile(void)
 {
  return tmpfile();
 }
 
 #undef PerlIO_importFILE
 PerlIO *
-PerlIO_importFILE(f,fl)
-FILE *f;
-int fl;
+PerlIO_importFILE(FILE *f, int fl)
 {
  return f;
 }
 
 #undef PerlIO_exportFILE
 FILE *
-PerlIO_exportFILE(f,fl)
-PerlIO *f;
-int fl;
+PerlIO_exportFILE(PerlIO *f, int fl)
 {
  return f;
 }
 
 #undef PerlIO_findFILE
 FILE *
-PerlIO_findFILE(f)
-PerlIO *f;
+PerlIO_findFILE(PerlIO *f)
 {
  return f;
 }
 
 #undef PerlIO_releaseFILE
 void
-PerlIO_releaseFILE(p,f)
-PerlIO *p;
-FILE *f;
+PerlIO_releaseFILE(PerlIO *p, FILE *f)
 {
 }
 
 void
-PerlIO_init()
+PerlIO_init(void)
 {
  /* Does nothing (yet) except force this file to be included 
     in perl binary. That allows this file to force inclusion
@@ -531,9 +474,7 @@ PerlIO_init()
 #ifndef HAS_FSETPOS
 #undef PerlIO_setpos
 int
-PerlIO_setpos(f,pos)
-PerlIO *f;
-const Fpos_t *pos;
+PerlIO_setpos(PerlIO *f, const Fpos_t *pos)
 {
  return PerlIO_seek(f,*pos,0); 
 }
@@ -541,9 +482,7 @@ const Fpos_t *pos;
 #ifndef PERLIO_IS_STDIO
 #undef PerlIO_setpos
 int
-PerlIO_setpos(f,pos)
-PerlIO *f;
-const Fpos_t *pos;
+PerlIO_setpos(PerlIO *f, const Fpos_t *pos)
 {
  return fsetpos(f, pos);
 }
@@ -553,9 +492,7 @@ const Fpos_t *pos;
 #ifndef HAS_FGETPOS
 #undef PerlIO_getpos
 int
-PerlIO_getpos(f,pos)
-PerlIO *f;
-Fpos_t *pos;
+PerlIO_getpos(PerlIO *f, Fpos_t *pos)
 {
  *pos = PerlIO_tell(f);
  return 0;
@@ -564,9 +501,7 @@ Fpos_t *pos;
 #ifndef PERLIO_IS_STDIO
 #undef PerlIO_getpos
 int
-PerlIO_getpos(f,pos)
-PerlIO *f;
-Fpos_t *pos;
+PerlIO_getpos(PerlIO *f, Fpos_t *pos)
 {
  return fgetpos(f, pos);
 }
@@ -576,17 +511,14 @@ Fpos_t *pos;
 #if (defined(PERLIO_IS_STDIO) || !defined(USE_SFIO)) && !defined(HAS_VPRINTF)
 
 int
-vprintf(pat, args)
-char *pat, *args;
+vprintf(char *pat, char *args)
 {
     _doprnt(pat, args, stdout);
     return 0;          /* wrong, but perl doesn't use the return value */
 }
 
 int
-vfprintf(fd, pat, args)
-FILE *fd;
-char *pat, *args;
+vfprintf(FILE *fd, char *pat, char *args)
 {
     _doprnt(pat, args, fd);
     return 0;          /* wrong, but perl doesn't use the return value */
diff --git a/perly.c b/perly.c
index 739c347..938a574 100644 (file)
--- a/perly.c
+++ b/perly.c
@@ -1801,7 +1801,7 @@ case 57:
 { STRLEN n_a; char *name = SvPV(((SVOP*)yyvsp[0].opval)->op_sv,n_a);
                          if (strEQ(name, "BEGIN") || strEQ(name, "END")
                              || strEQ(name, "INIT"))
-                             CvUNIQUE_on(PL_compcv);
+                             CvSPECIAL_on(PL_compcv);
                          yyval.opval = yyvsp[0].opval; }
 break;
 case 58:
@@ -1826,7 +1826,7 @@ case 63:
 break;
 case 64:
 #line 330 "perly.y"
-{ CvUNIQUE_on(PL_compcv); /* It's a BEGIN {} */ }
+{ CvSPECIAL_on(PL_compcv); /* It's a BEGIN {} */ }
 break;
 case 65:
 #line 332 "perly.y"
diff --git a/perly.h b/perly.h
index 8b0bdbb..926efd4 100644 (file)
--- a/perly.h
+++ b/perly.h
@@ -1,3 +1,4 @@
+#ifdef PERL_CORE
 #define WORD 257
 #define METHOD 258
 #define FUNCMETH 259
@@ -56,6 +57,8 @@
 #define POSTINC 312
 #define POSTDEC 313
 #define ARROW 314
+#endif /* PERL_CORE */
+
 typedef union {
     I32        ival;
     char *pval;
diff --git a/perly.y b/perly.y
index bef7d9a..565439b 100644 (file)
--- a/perly.y
+++ b/perly.y
@@ -307,7 +307,7 @@ startformsub:       /* NULL */      /* start a format subroutine scope */
 subname        :       WORD    { STRLEN n_a; char *name = SvPV(((SVOP*)$1)->op_sv,n_a);
                          if (strEQ(name, "BEGIN") || strEQ(name, "END")
                              || strEQ(name, "INIT"))
-                             CvUNIQUE_on(PL_compcv);
+                             CvSPECIAL_on(PL_compcv);
                          $$ = $1; }
        ;
 
@@ -327,7 +327,7 @@ package :   PACKAGE WORD ';'
        ;
 
 use    :       USE startsub
-                       { CvUNIQUE_on(PL_compcv); /* It's a BEGIN {} */ }
+                       { CvSPECIAL_on(PL_compcv); /* It's a BEGIN {} */ }
                    WORD WORD listexpr ';'
                        { utilize($1, $2, $4, $5, $6); }
        ;
index 061d2f6..0c0520c 100644 (file)
@@ -82,6 +82,17 @@ maintenance versions.
 
 =head1 Core Changes
 
+=head2 Unicode and UTF-8 support
+
+Perl can optionally use UTF-8 as its internal representation for character
+strings.  The C<use utf8> pragma enables this support in the current lexical
+scope.  See L<utf8> for more information.
+
+=head2 Lexically scoped warning categories
+
+You can now control the granularity of warnings emitted by perl at a finer
+level using the C<use warning> pragma.  See L<warning> for details.
+
 =head2 Binary numbers supported
 
 Binary numbers are now supported as literals, in s?printf formats, and
@@ -268,9 +279,11 @@ consistently croak() if the date falls in an unsupported range.
 
 =head2 Pragmata
 
-Lexical warnings pragma, "use warning;", to control optional warnings.
+C<use utf8;>, to enable UTF-8 and Unicode support.
+
+Lexical warnings pragma, C<use warning;>, to control optional warnings.
 
-Filetest pragma, to control the behaviour of filetests (C<-r> C<-w> ...).
+C<use filetest;>, to control the behaviour of filetests (C<-r> C<-w> ...).
 Currently only one subpragma implemented, "use filetest 'access';",
 that enables the use of access(2) or equivalent to check the
 permissions instead of using stat(2) as usual.  This matters
@@ -324,13 +337,6 @@ to skip installing perl also as /usr/bin/perl.  This is useful if you
 prefer not to modify /usr/bin for some reason or another but harmful
 because many scripts assume to find Perl in /usr/bin/perl.
 
-=head1 Configuration Changes
-
-You can use "Configure -Uinstallusrbinperl" which causes installperl
-to skip installing perl also as /usr/bin/perl.  This is useful if you
-prefer not to modify /usr/bin for some reason or another but harmful
-because many scripts assume to find Perl in /usr/bin/perl.
-
 =head1 BUGS
 
 If you find what you think is a bug, you might check the headers of
index 8d8e9a6..a193d67 100644 (file)
@@ -12,11 +12,12 @@ operators take more than one argument, while unary operators can never
 take more than one argument.  Thus, a comma terminates the argument of
 a unary operator, but merely separates the arguments of a list
 operator.  A unary operator generally provides a scalar context to its
-argument, while a list operator may provide either scalar and list
+argument, while a list operator may provide either scalar or list
 contexts for its arguments.  If it does both, the scalar arguments will
 be first, and the list argument will follow.  (Note that there can ever
 be only one such list argument.)  For instance, splice() has three scalar
-arguments followed by a list.
+arguments followed by a list, whereas gethostbyname() has four scalar
+arguments.
 
 In the syntax descriptions that follow, list operators that expect a
 list (and provide list context for the elements of the list) are shown
@@ -47,6 +48,11 @@ example, the third line above produces:
     print (...) interpreted as function at - line 1.
     Useless use of integer addition in void context at - line 1.
 
+A few functions take no arguments at all, and therefore work as neither
+unary nor list operators.  These include such functions as C<time>
+and C<endpwent>.  For example, C<time+86_400> always means
+C<time() + 86_400>.
+
 For functions that can be used in either a scalar or list context,
 nonabortive failure is generally indicated in a scalar context by
 returning the undefined value, and in a list context by returning the
@@ -56,7 +62,7 @@ Remember the following important rule: There is B<no rule> that relates
 the behavior of an expression in list context to its behavior in scalar
 context, or vice versa.  It might do two totally different things.
 Each operator and function decides which sort of value it would be most
-appropriate to return in a scalar context.  Some operators return the
+appropriate to return in scalar context.  Some operators return the
 length of the list that would have been returned in list context.  Some
 operators return the first value in the list.  Some operators return the
 last value in the list.  Some operators return a count of successful
@@ -209,10 +215,10 @@ C<dbmclose>, C<dbmopen>
 
 =head2 Portability
 
-Perl was born in UNIX and therefore it can access all the common UNIX
-system calls.  In non-UNIX environments the functionality of many
-UNIX system calls may not be available or the details of the available
-functionality may be slightly different.  The Perl functions affected
+Perl was born in Unix and can therefore access all common Unix
+system calls.  In non-Unix environments, the functionality of some
+Unix system calls may not be available, or details of the available
+functionality may differ slightly.  The Perl functions affected
 by this are:
 
 C<-X>, C<binmode>, C<chmod>, C<chown>, C<chroot>, C<crypt>,
@@ -224,13 +230,13 @@ C<getppid>, C<getprgp>, C<getpriority>, C<getprotobynumber>,
 C<getprotoent>, C<getpwent>, C<getpwnam>, C<getpwuid>,
 C<getservbyport>, C<getservent>, C<getsockopt>, C<glob>, C<ioctl>,
 C<kill>, C<link>, C<lstat>, C<msgctl>, C<msgget>, C<msgrcv>,
-C<msgsnd>, C<open>, C<pipe>, C<readlink>, C<select>, C<semctl>,
+C<msgsnd>, C<open>, C<pipe>, C<readlink>, C<rename>, C<select>, C<semctl>,
 C<semget>, C<semop>, C<setgrent>, C<sethostent>, C<setnetent>,
 C<setpgrp>, C<setpriority>, C<setprotoent>, C<setpwent>,
 C<setservent>, C<setsockopt>, C<shmctl>, C<shmget>, C<shmread>,
-C<shmwrite>, C<socketpair>, C<stat>, C<symlink>, C<syscall>,
-C<sysopen>, C<system>, C<times>, C<truncate>, C<umask>, C<utime>,
-C<wait>, C<waitpid>
+C<shmwrite>, C<socket>, C<socketpair>, C<stat>, C<symlink>, C<syscall>,
+C<sysopen>, C<system>, C<times>, C<truncate>, C<umask>, C<unlink>,
+C<utime>, C<wait>, C<waitpid>
 
 For more information about the portability of these functions, see
 L<perlport> and other available platform-specific documentation.
@@ -307,15 +313,14 @@ reasons may be for example network filesystem access controls, ACLs
 (access control lists), read-only filesystems, and unrecognized
 executable formats.
 
-Also note that, for the superuser on the local filesystems, C<-r>,
-C<-R>, C<-w>, and C<-W> always return 1, and C<-x> and C<-X> return 1
+Also note that, for the superuser on the local filesystems, the C<-r>,
+C<-R>, C<-w>, and C<-W> tests always return 1, and C<-x> and C<-X> return 1
 if any execute bit is set in the mode.  Scripts run by the superuser
 may thus need to do a stat() to determine the actual mode of the file,
-or temporarily set the uid to something else.
+or temporarily set their effective uid to something else.
 
 If you are using ACLs, there is a pragma called C<filetest> that may
 produce more accurate results than the bare stat() mode bits.
-
 When under the C<use filetest 'access'> the above-mentioned filetests
 will test whether the permission can (not) be granted using the
 access() family of system calls.  Also note that the C<-x> and C<-X> may
@@ -369,7 +374,7 @@ If VALUE is omitted, uses C<$_>.
 
 Accepts an incoming socket connect, just as the accept(2) system call
 does.  Returns the packed address if it succeeded, FALSE otherwise.
-See example in L<perlipc/"Sockets: Client/Server Communication">.
+See the example in L<perlipc/"Sockets: Client/Server Communication">.
 
 =item alarm SECONDS
 
@@ -386,8 +391,12 @@ starting a new one.  The returned value is the amount of time remaining
 on the previous timer.
 
 For delays of finer granularity than one second, you may use Perl's
-C<syscall()> interface to access setitimer(2) if your system supports it,
-or else see L</select()>.  It is usually a mistake to intermix C<alarm()>
+four-arugment version of select() leaving the first three arguments
+undefined, or you might be able to use the C<syscall()> interface to
+access setitimer(2) if your system supports it.  The Time::HiRes module
+from CPAN may also prove useful.
+
+It is usually a mistake to intermix C<alarm()>
 and C<sleep()> calls.
 
 If you want to use C<alarm()> to time out a system call you need to use an
@@ -429,33 +438,40 @@ L<perlipc/"Sockets: Client/Server Communication">.
 =item binmode FILEHANDLE
 
 Arranges for the file to be read or written in "binary" mode in operating
-systems that distinguish between binary and text files.  Files that are
-not in binary mode have CR LF sequences translated to LF on input and LF
-translated to CR LF on output.  Binmode has no effect under Unix; in MS-DOS
-and similarly archaic systems, it may be imperative--otherwise your
-MS-DOS-damaged C library may mangle your file.  The key distinction between
-systems that need C<binmode()> and those that don't is their text file
-formats.  Systems like Unix, MacOS, and Plan9 that delimit lines with a single
-character, and that encode that character in C as C<"\n">, do not need
-C<binmode()>.  The rest need it.  If FILEHANDLE is an expression, the value
-is taken as the name of the filehandle.
+systems that distinguish between binary and text files.  Files that
+are not in binary mode have CR LF sequences translated to LF on input
+and LF translated to CR LF on output.  Binmode has no effect under
+many sytems, but in MS-DOS and similarly archaic systems, it may be
+imperative--otherwise your MS-DOS-damaged C library may mangle your file.
+The key distinction between systems that need C<binmode()> and those
+that don't is their text file formats.  Systems like Unix, MacOS, and
+Plan9 that delimit lines with a single character, and that encode that
+character in C as C<"\n">, do not need C<binmode()>.  The rest may need it.
+If FILEHANDLE is an expression, the value is taken as the name of the
+filehandle.
+
+If the system does care about it, using it when you shouldn't is just as
+perilous as failing to use it when you should.  Fortunately for most of
+us, you can't go wrong using binmode() on systems that don't care about
+it, though.
 
 =item bless REF,CLASSNAME
 
 =item bless REF
 
-This function tells the thingy referenced by REF that it is now
-an object in the CLASSNAME package--or the current package if no CLASSNAME
-is specified, which is often the case.  It returns the reference for
-convenience, because a C<bless()> is often the last thing in a constructor.
-Always use the two-argument version if the function doing the blessing
-might be inherited by a derived class.  See L<perltoot> and L<perlobj>
-for more about the blessing (and blessings) of objects.
+This function tells the thingy referenced by REF that it is now an object
+in the CLASSNAME package.  If CLASSNAME is omitted, the current package
+is used.  Because a C<bless()> is often the last thing in a constructor.
+it returns the reference for convenience.  Always use the two-argument
+version if the function doing the blessing might be inherited by a
+derived class.  See L<perltoot> and L<perlobj> for more about the blessing
+(and blessings) of objects.
 
 Consider always blessing objects in CLASSNAMEs that are mixed case.
-Namespaces with all lowercase names are considered reserved for Perl
-pragmata.  Builtin types have all uppercase names, so to prevent confusion,
-it is best to avoid such package names as well.
+Namespaces with all lowercase names are considered reserved for
+Perl pragmata.  Builtin types have all uppercase names, so to prevent
+confusion, you may wish to avoid such package names as well.  Make sure
+that CLASSNAME is a true value.
 
 See L<perlmod/"Perl Modules">.
 
@@ -498,9 +514,9 @@ previous time C<caller()> was called.
 
 =item chdir EXPR
 
-Changes the working directory to EXPR, if possible.  If EXPR is
-omitted, changes to home directory.  Returns TRUE upon success, FALSE
-otherwise.  See example under C<die()>.
+Changes the working directory to EXPR, if possible.  If EXPR is omitted,
+changes to the user's home directory.  Returns TRUE upon success,
+FALSE otherwise.  See the example under C<die()>.
 
 =item chmod LIST
 
@@ -523,14 +539,14 @@ successfully changed.  See also L</oct>, if all you have is a string.
 
 =item chomp
 
-This is a slightly safer version of L</chop>.  It removes any
-line ending that corresponds to the current value of C<$/> (also known as
+This safer version of L</chop> removes any trailing string
+that corresponds to the current value of C<$/> (also known as
 $INPUT_RECORD_SEPARATOR in the C<English> module).  It returns the total
 number of characters removed from all its arguments.  It's often used to
 remove the newline from the end of an input record when you're worried
-that the final record may be missing its newline.  When in paragraph mode
-(C<$/ = "">), it removes all trailing newlines from the string.  If
-VARIABLE is omitted, it chomps C<$_>.  Example:
+that the final record may be missing its newline.  When in paragraph
+mode (C<$/ = "">), it removes all trailing newlines from the string.
+If VARIABLE is omitted, it chomps C<$_>.  Example:
 
     while (<>) {
        chomp;  # avoid \n on last field
@@ -608,8 +624,9 @@ restrictions may be relaxed, but this is not a portable assumption.
 
 Returns the character represented by that NUMBER in the character set.
 For example, C<chr(65)> is C<"A"> in either ASCII or Unicode, and
-chr(0x263a) is a Unicode smiley face (but only within the scope of a
-C<use utf8>).  For the reverse, use L</ord>.
+chr(0x263a) is a Unicode smiley face (but only within the scope of
+a C<use utf8>).  For the reverse, use L</ord>.  
+See L<utf8> for more about Unicode.
 
 If NUMBER is omitted, uses C<$_>.
 
@@ -641,10 +658,10 @@ counter (C<$.>), while the implicit close done by C<open()> does not.
 If the file handle came from a piped open C<close()> will additionally
 return FALSE if one of the other system calls involved fails or if the
 program exits with non-zero status.  (If the only problem was that the
-program exited non-zero C<$!> will be set to C<0>.)  Also, closing a pipe 
-waits for the process executing on the pipe to complete, in case you
-want to look at the output of the pipe afterwards.  Closing a pipe
-explicitly also puts the exit status value of the command into C<$?>.
+program exited non-zero C<$!> will be set to C<0>.)  Closing a pipe 
+also waits for the process executing on the pipe to complete, in case you
+want to look at the output of the pipe afterwards, and 
+implicitly puts the exit status value of that command into C<$?>.
 
 Example:
 
@@ -756,13 +773,13 @@ for it is unwise.
 
 =item dbmclose HASH
 
-[This function has been superseded by the C<untie()> function.]
+[This function has been largely superseded by the C<untie()> function.]
 
 Breaks the binding between a DBM file and a hash.
 
 =item dbmopen HASH,DBNAME,MODE
 
-[This function has been superseded by the C<tie()> function.]
+[This function has been largely superseded by the C<tie()> function.]
 
 This binds a dbm(3), ndbm(3), sdbm(3), gdbm(3), or Berkeley DB file to a
 hash.  HASH is the name of the hash.  (Unlike normal C<open()>, the first
@@ -795,6 +812,13 @@ See also L<AnyDBM_File> for a more general description of the pros and
 cons of the various dbm approaches, as well as L<DB_File> for a particularly
 rich implementation.
 
+You can control which DBM library you use by loading that library
+before you call dbmopen():
+
+    use DB_File;
+    dbmopen(%NS_Hist, "$ENV{HOME}/.netscape/history.db")
+       or die "Can't open netscape history file: $!";
+
 =item defined EXPR
 
 =item defined
@@ -839,7 +863,7 @@ defined values.  For example, if you say
 
 The pattern match succeeds, and C<$1> is defined, despite the fact that it
 matched "nothing".  But it didn't really match nothing--rather, it
-matched something that happened to be C<0> characters long.  This is all
+matched something that happened to be zero characters long.  This is all
 very above-board and honest.  When a function returns an undefined value,
 it's an admission that it couldn't give you an honest answer.  So you
 should use C<defined()> only when you're questioning the integrity of what
@@ -885,9 +909,14 @@ And so does this:
 
     delete @HASH{keys %HASH}
 
-(But both of these are slower than just assigning the empty list, or
-using C<undef()>.)  Note that the EXPR can be arbitrarily complicated as
-long as the final operation is a hash element lookup or hash slice:
+But both of these are slower than just assigning the empty list
+or undefining it:
+
+    %hash = ();                # completely empty %hash
+    undef %hash;       # forget %hash every existed
+
+Note that the EXPR can be arbitrarily complicated as long as the final
+operation is a hash element lookup or hash slice:
 
     delete $ref->[$x][$y]{$key};
     delete @{$ref->[$x][$y]}{$key1, $key2, @morekeys};
@@ -925,7 +954,7 @@ produce, respectively
     /etc/games is no good at canasta line 123.
     /etc/games is no good, stopped at canasta line 123.
 
-See also C<exit()> and C<warn()>.
+See also exit(), warn(), and the Carp module.
 
 If LIST is empty and C<$@> already contains a value (typically from a
 previous eval) that value is reused after appending C<"\t...propagated">.
@@ -942,13 +971,15 @@ will be called with the error text and can change the error message, if
 it sees fit, by calling C<die()> again.  See L<perlvar/$SIG{expr}> for details on
 setting C<%SIG> entries, and L<"eval BLOCK"> for some examples.
 
-Note that the C<$SIG{__DIE__}> hook is called even inside eval()ed
-blocks/strings.  If one wants the hook to do nothing in such
+Note that the C<$SIG{__DIE__}> hook is currently called even inside
+eval()ed blocks/strings!  If one wants the hook to do nothing in such
 situations, put
 
        die @_ if $^S;
 
-as the first line of the handler (see L<perlvar/$^S>).
+as the first line of the handler (see L<perlvar/$^S>).  Because this
+promotes action at a distance, this counterintuitive behavior may be fixed
+in a future release.
 
 =item do BLOCK
 
@@ -958,7 +989,8 @@ modifier, executes the BLOCK once before testing the loop condition.
 (On other statements the loop modifiers test the conditional first.)
 
 C<do BLOCK> does I<not> count as a loop, so the loop control statements
-C<next>, C<last> or C<redo> cannot be used to leave or restart the block.
+C<next>, C<last>, or C<redo> cannot be used to leave or restart the block.
+See L<perlsyn> for alternative strategies.
 
 =item do SUBROUTINE(LIST)
 
@@ -976,17 +1008,16 @@ is just like
 
     scalar eval `cat stat.pl`;
 
-except that it's more efficient and concise, keeps track of the
-current filename for error messages, and searches all the B<-I>
-libraries if the file isn't in the current directory (see also the @INC
-array in L<perlvar/Predefined Names>).  It is also different in how
-code evaluated with C<do FILENAME> doesn't see lexicals in the enclosing
-scope like C<eval STRING> does.  It's the same, however, in that it does
-reparse the file every time you call it, so you probably don't want to
-do this inside a loop.
+except that it's more efficient and concise, keeps track of the current
+filename for error messages, searches the @INC libraries, and updates
+C<%INC> if the file is found.  See L<perlvar/Predefined Names> for these
+variables.  It also differs in that code evaluated with C<do FILENAME>
+cannot see lexicals in the enclosing scope; C<eval STRING> does.  It's the
+same, however, in that it does reparse the file every time you call it,
+so you probably don't want to do this inside a loop.
 
 If C<do> cannot read the file, it returns undef and sets C<$!> to the
-error.    If C<do> can read the file but cannot compile it, it
+error.  If C<do> can read the file but cannot compile it, it
 returns undef and sets an error message in C<$@>.   If the file is
 successfully compiled, C<do> returns the value of the last expression
 evaluated.
@@ -1000,7 +1031,8 @@ file.  Manual error checking can be done this way:
 
     # read in config files: system first, then user 
     for $file ("/share/prog/defaults.rc",
-               "$ENV{HOME}/.someprogrc") {
+               "$ENV{HOME}/.someprogrc") 
+   {
        unless ($return = do $file) {
            warn "couldn't parse $file: $@" if $@;
            warn "couldn't do $file: $!"    unless defined $return;
@@ -1094,11 +1126,11 @@ C<eof(FILEHANDLE)> on it) after end-of-file is reached.  Filetypes such
 as terminals may lose the end-of-file condition if you do.
 
 An C<eof> without an argument uses the last file read as argument.
-Using C<eof()> with empty parentheses is very different.  It indicates the pseudo file formed of
-the files listed on the command line, i.e., C<eof()> is reasonable to
-use inside a C<while (E<lt>E<gt>)> loop to detect the end of only the
-last file.  Use C<eof(ARGV)> or eof without the parentheses to test
-I<EACH> file in a while (E<lt>E<gt>) loop.  Examples:
+Using C<eof()> with empty parentheses is very different.  It indicates
+the pseudo file formed of the files listed on the command line, i.e.,
+C<eof()> is reasonable to use inside a C<while (E<lt>E<gt>)> loop to
+detect the end of only the last file.  Use C<eof(ARGV)> or eof without the
+parentheses to test I<EACH> file in a while (E<lt>E<gt>) loop.  Examples:
 
     # reset line numbering on each input file
     while (<>) {
@@ -1112,7 +1144,7 @@ I<EACH> file in a while (E<lt>E<gt>) loop.  Examples:
     while (<>) {
        if (eof()) {            # check for end of current file
            print "--------------\n";
-           close(ARGV);        # close or break; is needed if we
+           close(ARGV);        # close or last; is needed if we
                                # are reading from the terminal
        }
        print;
@@ -1181,10 +1213,11 @@ Examples:
     # a run-time error
     eval '$answer =';  # sets $@
 
-When using the C<eval{}> form as an exception trap in libraries, you may
-wish not to trigger any C<__DIE__> hooks that user code may have
-installed.  You can use the C<local $SIG{__DIE__}> construct for this
-purpose, as shown in this example:
+Due to the current arguably broken state of C<__DIE__> hooks, when using
+the C<eval{}> form as an exception trap in libraries, you may wish not
+to trigger any C<__DIE__> hooks that user code may have installed.
+You can use the C<local $SIG{__DIE__}> construct for this purpose,
+as shown in this example:
 
     # a very private exception trap for divide-by-zero
     eval { local $SIG{'__DIE__'}; $answer = $a / $b; };
@@ -1201,6 +1234,9 @@ C<die()> again, which has the effect of changing their error messages:
        print $@ if $@;                # prints "bar lives here"
     }
 
+Because this promotes action at a distance, this counterintuive behavior
+may be fixed in a future release.
+
 With an C<eval()>, you should be especially careful to remember what's
 being looked at when:
 
@@ -1225,8 +1261,7 @@ particular situation, you can just use symbolic references instead, as
 in case 6.
 
 C<eval BLOCK> does I<not> count as a loop, so the loop control statements
-C<next>, C<last> or C<redo> cannot be used to leave or restart the block.
-
+C<next>, C<last>, or C<redo> cannot be used to leave or restart the block.
 
 =item exec LIST
 
@@ -1285,9 +1320,9 @@ shell expanding wildcards or splitting up words with whitespace in them.
 
     @args = ( "echo surprise" );
 
-    system @args;               # subject to shell escapes
+    exec @args;               # subject to shell escapes
                                 # if @args == 1
-    system { $args[0] } @args;  # safe even with one-arg list
+    exec { $args[0] } @args;  # safe even with one-arg list
 
 The first version, the one without the indirect object, ran the I<echo>
 program, passing it C<"surprise"> an argument.  The second version
@@ -1302,9 +1337,9 @@ any C<DESTROY> methods in your objects.
 Returns TRUE if the specified hash key exists in its hash array, even
 if the corresponding value is undefined.
 
-    print "Exists\n" if exists $array{$key};
-    print "Defined\n" if defined $array{$key};
-    print "True\n" if $array{$key};
+    print "Exists\n"   if exists $array{$key};
+    print "Defined\n"  if defined $array{$key};
+    print "True\n"      if $array{$key};
 
 A hash element can be TRUE only if it's defined, and defined if
 it exists, but the reverse doesn't necessarily hold true.
@@ -1312,40 +1347,53 @@ it exists, but the reverse doesn't necessarily hold true.
 Note that the EXPR can be arbitrarily complicated as long as the final
 operation is a hash key lookup:
 
-    if (exists $ref->{"A"}{"B"}{$key}) { ... }
+    if (exists $ref->{A}->{B}->{$key})         { }
+    if (exists $hash{A}{B}{$key})      { }
+
+Although the last element will not spring into existence just because
+its existence was tested, intervening ones will.  Thus C<$ref-E<gt>{"A"}>
+and C<$ref-E<gt>{"A"}-E<gt>{"B"}> will spring into existence due to the
+existence test for a $key element.  This happens anywhere the arrow
+operator is used, including even 
 
-Although the last element will not spring into existence just because its
-existence was tested, intervening ones will.  Thus C<$ref-E<gt>{"A"}>
-C<$ref-E<gt>{"B"}> will spring into existence due to the existence
-test for a $key element.  This autovivification may be fixed in a later
+    undef $ref;
+    if (exists $ref->{"Some key"})     { }
+    print $ref;            # prints HASH(0x80d3d5c)
+
+This surprising autovivification in what does not at first--or even
+second--glance appear to be an lvalue context may be fixed in a future
 release.
 
 =item exit EXPR
 
-Evaluates EXPR and exits immediately with that value.  (Actually, it
-calls any defined C<END> routines first, but the C<END> routines may not
-abort the exit.  Likewise any object destructors that need to be called
-are called before exit.)  Example:
+Evaluates EXPR and exits immediately with that value.    Example:
 
     $ans = <STDIN>;
     exit 0 if $ans =~ /^[Xx]/;
 
 See also C<die()>.  If EXPR is omitted, exits with C<0> status.  The only
-universally portable values for EXPR are C<0> for success and C<1> for error;
-all other values are subject to unpredictable interpretation depending
-on the environment in which the Perl program is running.
+universally recognized values for EXPR are C<0> for success and C<1>
+for error; other values are subject to interpretation depending on the
+environment in which the Perl program is running.  For example, exiting
+69 (EX_UNAVAILABLE) from a I<sendmail> incoming-mail filter will cause
+the mailer to return the item undelivered, but that's not true everywhere.
 
-You shouldn't use C<exit()> to abort a subroutine if there's any chance that
+Don't use C<exit()> to abort a subroutine if there's any chance that
 someone might want to trap whatever error happened.  Use C<die()> instead,
 which can be trapped by an C<eval()>.
 
-All C<END{}> blocks are run at exit time.  See L<perlsub> for details.
+The exit() function does not always exit immediately. It calls any
+defined C<END> routines first, but these C<END> routines may not
+themselves abort the exit. Likewise any object destructors that need to
+be called are called before the real exit.  If this is a problem, you
+can call C<POSIX:_exit($status)> to avoid END and destructor processing.
+See L<perlsub> for details.
 
 =item exp EXPR
 
 =item exp
 
-Returns I<e> (the natural logarithm base) to the power of EXPR.
+Returns I<e> (the natural logarithm base) to the power of EXPR.  
 If EXPR is omitted, gives C<exp($_)>.
 
 =item fcntl FILEHANDLE,FUNCTION,SCALAR
@@ -1362,22 +1410,23 @@ For example:
     fcntl($filehandle, F_GETFL, $packed_return_buffer)
        or die "can't fcntl F_GETFL: $!";
 
-You don't have to check for C<defined()> on the return from 
-C<fnctl()>.  Like C<ioctl()>, it maps a C<0> return from the system
-call into "C<0> but true" in Perl.  This string is true in 
-boolean context and C<0> in numeric context.  It is also 
-exempt from the normal B<-w> warnings on improper numeric
-conversions.
+You don't have to check for C<defined()> on the return from C<fnctl()>.
+Like C<ioctl()>, it maps a C<0> return from the system call into "C<0>
+but true" in Perl.  This string is true in boolean context and C<0>
+in numeric context.  It is also exempt from the normal B<-w> warnings
+on improper numeric conversions.
 
 Note that C<fcntl()> will produce a fatal error if used on a machine that
-doesn't implement fcntl(2).
+doesn't implement fcntl(2).  See the Fcntl module or your fcntl(2)
+manpage to learn what functions are available on your system.
 
 =item fileno FILEHANDLE
 
-Returns the file descriptor for a filehandle.  This is useful for
-constructing bitmaps for C<select()> and low-level POSIX tty-handling
-operations.  If FILEHANDLE is an expression, the value is taken as 
-an indirect filehandle, generally its name. 
+Returns the file descriptor for a filehandle, or undefined if the
+filehandle is not open.  This is mainly useful for constructing
+bitmaps for C<select()> and low-level POSIX tty-handling operations.
+If FILEHANDLE is an expression, the value is taken as an indirect
+filehandle, generally its name.
 
 You can use this to find out whether two handles refer to the 
 same underlying descriptor:
@@ -1388,18 +1437,23 @@ same underlying descriptor:
 
 =item flock FILEHANDLE,OPERATION
 
-Calls flock(2), or an emulation of it, on FILEHANDLE.  Returns TRUE for
-success, FALSE on failure.  Produces a fatal error if used on a machine
-that doesn't implement flock(2), fcntl(2) locking, or lockf(3).  C<flock()>
-is Perl's portable file locking interface, although it locks only entire
-files, not records.
-
-On many platforms (including most versions or clones of Unix), locks
-established by C<flock()> are B<merely advisory>.  Such discretionary locks
-are more flexible, but offer fewer guarantees.  This means that files
-locked with C<flock()> may be modified by programs that do not also use
-C<flock()>.  Windows NT and OS/2 are among the platforms which
-enforce mandatory locking.  See your local documentation for details.
+Calls flock(2), or an emulation of it, on FILEHANDLE.  Returns TRUE
+for success, FALSE on failure.  Produces a fatal error if used on a
+machine that doesn't implement flock(2), fcntl(2) locking, or lockf(3).
+C<flock()> is Perl's portable file locking interface, although it locks
+only entire files, not records.
+
+Two potentially non-obvious but traditional C<flock> semantics are
+that it waits indefinitely until the lock is granted, and that its locks
+B<merely advisory>.  Such discretionary locks are more flexible, but offer
+fewer guarantees.  This means that files locked with C<flock()> may be
+modified by programs that do not also use C<flock()>.  See L<perlport>,
+your port's specific documentation, or your system-specific local manpages
+for details.  It's best to assume traditional behavior if you're writing
+portable programs.  (But if you're not, you should as always feel perfectly
+free to write for your own system's idiosyncrasies (sometimes called
+"features").  Slavish adherence to portability concerns shouldn't get
+in the way of your getting your job done.)
 
 OPERATION is one of LOCK_SH, LOCK_EX, or LOCK_UN, possibly combined with
 LOCK_NB.  These constants are traditionally valued 1, 2, 8 and 4, but
@@ -1410,12 +1464,12 @@ releases a previously requested lock.  If LOCK_NB is added to LOCK_SH or
 LOCK_EX then C<flock()> will return immediately rather than blocking
 waiting for the lock (check the return status to see if you got it).
 
-To avoid the possibility of mis-coordination, Perl flushes FILEHANDLE
-before (un)locking it.
+To avoid the possibility of miscoordination, Perl now flushes FILEHANDLE
+before locking or unlocking it.
 
 Note that the emulation built with lockf(3) doesn't provide shared
 locks, and it requires that FILEHANDLE be open with write intent.  These
-are the semantics that lockf(3) implements.  Most (all?) systems
+are the semantics that lockf(3) implements.  Most if not all systems
 implement lockf(3) in terms of fcntl(2) locking, though, so the
 differing semantics shouldn't bite too many people.
 
@@ -1448,44 +1502,37 @@ Here's a mailbox appender for BSD systems.
     print MBOX $msg,"\n\n";
     unlock();
 
+On systems that support a real flock(), locks are inherited across fork()
+calls, whereas those that must resort to the more capricious fcntl()
+function lose the locks, making it harder to write servers.
+
 See also L<DB_File> for other flock() examples.
 
 =item fork
 
-Does a fork(2) system call.  Returns the child pid to the parent process,
-C<0> to the child process, or C<undef> if the fork is unsuccessful.
+Does a fork(2) system call to create a new process running the
+same program at the same point.  It returns the child pid to the
+parent process, C<0> to the child process, or C<undef> if the fork is
+unsuccessful.  File descriptors (and sometimes locks on those descriptors)
+are shared, while everything else is copied.  On most systems supporting
+fork(), great care has gone into making it extremely efficient (for
+example, using copy-on-write technology on data pages), making it the
+dominant paradigm for multitasking over the last few decades.
 
 Note: unflushed buffers remain unflushed in both processes, which means
 you may need to set C<$|> ($AUTOFLUSH in English) or call the C<autoflush()>
 method of C<IO::Handle> to avoid duplicate output.
 
-If you C<fork()> without ever waiting on your children, you will accumulate
-zombies:
-
-    $SIG{CHLD} = sub { wait };
-
-There's also the double-fork trick (error checking on
-C<fork()> returns omitted);
-
-    unless ($pid = fork) {
-       unless (fork) {
-           exec "what you really wanna do";
-           die "no exec";
-           # ... or ...
-           ## (some_perl_code_here)
-           exit 0;
-       }
-       exit 0;
-    }
-    waitpid($pid,0);
-
-See also L<perlipc> for more examples of forking and reaping
-moribund children.
+If you C<fork()> without ever waiting on your children, you will
+accumulate zombies.  On some systems, you can avoid this by setting
+C<$SIG{CHLD}> to C<"IGNORE">.  See also L<perlipc> for more examples of
+forking and reaping moribund children.
 
 Note that if your forked child inherits system file descriptors like
 STDIN and STDOUT that are actually connected by a pipe or socket, even
-if you exit, then the remote server (such as, say, httpd or rsh) won't think
-you're done.  You should reopen those to F</dev/null> if it's any issue.
+if you exit, then the remote server (such as, say, a CGI script or a
+backgrounded job launced from a remote shell) won't think you're done.
+You should reopen those to F</dev/null> if it's any issue.
 
 =item format
 
@@ -1528,10 +1575,11 @@ C<formline()> always returns TRUE.  See L<perlform> for other examples.
 =item getc
 
 Returns the next character from the input file attached to FILEHANDLE,
-or the undefined value at end of file, or if there was an error.  If
-FILEHANDLE is omitted, reads from STDIN.  This is not particularly
-efficient.  It cannot be used to get unbuffered single-characters,
-however.  For that, try something more like:
+or the undefined value at end of file, or if there was an error.
+If FILEHANDLE is omitted, reads from STDIN.  This is not particularly
+efficient.  However, it cannot be used by itself to fetch single
+characters without waiting for the user to hit enter.  For that, try
+something more like:
 
     if ($BSD_STYLE) {
        system "stty cbreak </dev/tty >/dev/tty 2>&1";
@@ -1553,10 +1601,10 @@ however.  For that, try something more like:
 Determination of whether $BSD_STYLE should be set
 is left as an exercise to the reader.
 
-The C<POSIX::getattr()> function can do this more portably on systems
-purporting POSIX compliance.
-See also the C<Term::ReadKey> module from your nearest CPAN site;
-details on CPAN can be found on L<perlmodlib/CPAN>.
+The C<POSIX::getattr()> function can do this more portably on
+systems purporting POSIX compliance.  See also the C<Term::ReadKey>
+module from your nearest CPAN site; details on CPAN can be found on
+L<perlmodlib/CPAN>.
 
 =item getlogin
 
@@ -1684,21 +1732,26 @@ lookup by name, in which case you get the other thing, whatever it is.
     $name  = getgrent();
     #etc.
 
-In I<getpw*()> the fields C<$quota>, C<$comment>, and C<$expire> are special
-cases in the sense that in many systems they are unsupported.  If the
-C<$quota> is unsupported, it is an empty scalar.  If it is supported, it
-usually encodes the disk quota.  If the C<$comment> field is unsupported,
-it is an empty scalar.  If it is supported it usually encodes some
-administrative comment about the user.  In some systems the $quota
-field may be C<$change> or C<$age>, fields that have to do with password
-aging.  In some systems the C<$comment> field may be C<$class>.  The C<$expire>
-field, if present, encodes the expiration period of the account or the
-password.  For the availability and the exact meaning of these fields
-in your system, please consult your getpwnam(3) documentation and your
-F<pwd.h> file.  You can also find out from within Perl which meaning
-your C<$quota> and C<$comment> fields have and whether you have the C<$expire>
-field by using the C<Config> module and the values C<d_pwquota>, C<d_pwage>,
-C<d_pwchange>, C<d_pwcomment>, and C<d_pwexpire>.
+In I<getpw*()> the fields C<$quota>, C<$comment>, and C<$expire> are
+special cases in the sense that in many systems they are unsupported.
+If the C<$quota> is unsupported, it is an empty scalar.  If it is
+supported, it usually encodes the disk quota.  If the C<$comment>
+field is unsupported, it is an empty scalar.  If it is supported it
+usually encodes some administrative comment about the user.  In some
+systems the $quota field may be C<$change> or C<$age>, fields that have
+to do with password aging.  In some systems the C<$comment> field may
+be C<$class>.  The C<$expire> field, if present, encodes the expiration
+period of the account or the password.  For the availability and the
+exact meaning of these fields in your system, please consult your
+getpwnam(3) documentation and your F<pwd.h> file.  You can also find
+out from within Perl what your C<$quota> and C<$comment> fields mean
+and whether you have the C<$expire> field by using the C<Config> module
+and the values C<d_pwquota>, C<d_pwage>, C<d_pwchange>, C<d_pwcomment>,
+and C<d_pwexpire>.  Shadow password files are only supported if your
+vendor has implemented them in the intuitive fashion that calling the
+regular C library routines gets the shadow versions if you're running
+under privilege.  Those that incorrectly implement a separate library
+call are not supported.
 
 The C<$members> value returned by I<getgr*()> is a space separated list of
 the login names of the members of the group.
@@ -1712,6 +1765,15 @@ by saying something like:
 
     ($a,$b,$c,$d) = unpack('C4',$addr[0]);
 
+The Socket library makes this slightly easier:
+
+    use Socket;
+    $iaddr = inet_aton("127.1"); # or whatever address
+    $name  = gethostbyaddr($iaddr, AF_INET);
+
+    # or going the other way
+    $straddr = inet_ntoa($iaddr");
+
 If you get tired of remembering which element of the return list contains
 which return value, by-name interfaces are also provided in modules:
 C<File::stat>, C<Net::hostent>, C<Net::netent>, C<Net::protoent>, C<Net::servent>,
@@ -1742,11 +1804,11 @@ Returns the socket option requested, or undef if there is an error.
 
 =item glob
 
-Returns the value of EXPR with filename expansions such as the standard Unix shell F</bin/sh> would
-do.  This is the internal function implementing the C<E<lt>*.cE<gt>>
-operator, but you can use it directly.  If EXPR is omitted, C<$_> is used.
-The C<E<lt>*.cE<gt>> operator is discussed in more detail in
-L<perlop/"I/O Operators">.
+Returns the value of EXPR with filename expansions such as the
+standard Unix shell F</bin/csh> would do.  This is the internal function
+implementing the C<E<lt>*.cE<gt>> operator, but you can use it directly.
+If EXPR is omitted, C<$_> is used.  The C<E<lt>*.cE<gt>> operator is
+discussed in more detail in L<perlop/"I/O Operators">.
 
 =item gmtime EXPR
 
@@ -1759,9 +1821,12 @@ Typically used as follows:
                                            gmtime(time);
 
 All array elements are numeric, and come straight out of a struct tm.
-In particular this means that C<$mon> has the range C<0..11> and C<$wday> has
-the range C<0..6> with sunday as day C<0>.  Also, C<$year> is the number of
-years since 1900, that is, C<$year> is C<123> in year 2023, I<not> simply the last two digits of the year.
+In particular this means that C<$mon> has the range C<0..11> and C<$wday>
+has the range C<0..6> with sunday as day C<0>.  Also, C<$year> is the
+number of years since 1900, that is, C<$year> is C<123> in year 2023,
+I<not> simply the last two digits of the year.  If you assume it is,
+then you create non-Y2K-compliant programs--and you wouldn't want to do
+that, would you?
 
 If EXPR is omitted, does C<gmtime(time())>.
 
@@ -1772,18 +1837,19 @@ In scalar context, returns the ctime(3) value:
 Also see the C<timegm()> function provided by the C<Time::Local> module,
 and the strftime(3) function available via the POSIX module.
 
-This scalar value is B<not> locale dependent, see L<perllocale>, but
-instead a Perl builtin.  Also see the C<Time::Local> module, and the
-strftime(3) and mktime(3) function available via the POSIX module.  To
+This scalar value is B<not> locale dependent (see L<perllocale>), but
+is instead a Perl builtin.  Also see the C<Time::Local> module, and the
+strftime(3) and mktime(3) functions available via the POSIX module.  To
 get somewhat similar but locale dependent date strings, set up your
 locale environment variables appropriately (please see L<perllocale>)
 and try for example:
 
     use POSIX qw(strftime);
-       $now_string = strftime "%a %b %e %H:%M:%S %Y", gmtime;
+    $now_string = strftime "%a %b %e %H:%M:%S %Y", gmtime;
 
-Note that the C<%a> and C<%b>, the short forms of the day of the week
-and the month of the year, may not necessarily be three characters wide.
+Note that the C<%a> and C<%b> escapes, which represent the short forms
+of the day of the week and the month of the year, may not necessarily
+be three characters wide in all locales.
 
 =item goto LABEL
 
@@ -1819,13 +1885,12 @@ will be able to tell that this routine was called first.
 
 =item grep EXPR,LIST
 
-This is similar in spirit to, but not the same as, grep(1)
-and its relatives.  In particular, it is not limited to using
-regular expressions.
+This is similar in spirit to, but not the same as, grep(1) and its
+relatives.  In particular, it is not limited to using regular expressions.
 
 Evaluates the BLOCK or EXPR for each element of LIST (locally setting
 C<$_> to each element) and returns the list value consisting of those
-elements for which the expression evaluated to TRUE.  In a scalar
+elements for which the expression evaluated to TRUE.  In scalar
 context, returns the number of times the expression was TRUE.
 
     @foo = grep(!/^#/, @bar);    # weed out comments
@@ -1834,14 +1899,14 @@ or equivalently,
 
     @foo = grep {!/^#/} @bar;    # weed out comments
 
-Note that, because C<$_> is a reference into the list value, it can be used
-to modify the elements of the array.  While this is useful and
-supported, it can cause bizarre results if the LIST is not a named
-array.  Similarly, grep returns aliases into the original list,
-much like the way that a for loop's index variable aliases the list
-elements.  That is, modifying an element of a list returned by grep
-(for example, in a C<foreach>, C<map()> or another C<grep()>)
-actually modifies the element in the original list.
+Note that, because C<$_> is a reference into the list value, it can
+be used to modify the elements of the array.  While this is useful and
+supported, it can cause bizarre results if the LIST is not a named array.
+Similarly, grep returns aliases into the original list, much as a for
+loop's index variable aliases the list elements.  That is, modifying an
+element of a list returned by grep (for example, in a C<foreach>, C<map()>
+or another C<grep()>) actually modifies the element in the original list.
+This is usually something to be avoided when writing clear code.
 
 See also L</map> for an array composed of the results of the BLOCK or EXPR.
 
@@ -1849,9 +1914,9 @@ See also L</map> for an array composed of the results of the BLOCK or EXPR.
 
 =item hex
 
-Interprets EXPR as a hex string and returns the corresponding
-value.  (To convert strings that might start with either 0 or 0x
-see L</oct>.)  If EXPR is omitted, uses C<$_>.
+Interprets EXPR as a hex string and returns the corresponding value.
+(To convert strings that might start with either 0, 0x, or 0b, see
+L</oct>.)  If EXPR is omitted, uses C<$_>.
 
     print hex '0xAf'; # prints '175'
     print hex 'aF';   # same
@@ -1867,29 +1932,34 @@ for the package used.  See also L</use()>, L<perlmod>, and L<Exporter>.
 
 =item index STR,SUBSTR
 
-Returns the position of the first occurrence of SUBSTR in STR at or after
-POSITION.  If POSITION is omitted, starts searching from the beginning of
-the string.  The return value is based at C<0> (or whatever you've set the C<$[>
-variable to--but don't do that).  If the substring is not found, returns
-one less than the base, ordinarily C<-1>.
+The index function searches for one string within another, but without
+the wildcard-like behavior of a full regular-expression pattern match.
+It returns the position of the first occurrence of SUBSTR in STR at
+or after POSITION.  If POSITION is omitted, starts searching from the
+beginning of the string.  The return value is based at C<0> (or whatever
+you've set the C<$[> variable to--but don't do that).  If the substring
+is not found, returns one less than the base, ordinarily C<-1>.
 
 =item int EXPR
 
 =item int
 
 Returns the integer portion of EXPR.  If EXPR is omitted, uses C<$_>.
-You should not use this for rounding, because it truncates
-towards C<0>, and because machine representations of floating point
-numbers can sometimes produce counterintuitive results.  Usually C<sprintf()> or C<printf()>,
-or the C<POSIX::floor> or C<POSIX::ceil> functions, would serve you better.
+You should not use this function for rounding: one because it truncates
+towards C<0>, and two because machine representations of floating point
+numbers can sometimes produce counterintuitive results.  For example,
+C<int(-6.725/0.025)> produces -268 rather than the correct -269; that's
+because it's really more like -268.99999999999994315658 instead.  Usually,
+the C<sprintf()>, C<printf()>, or the C<POSIX::floor> and C<POSIX::ceil>
+functions will serve you better than will int().
 
 =item ioctl FILEHANDLE,FUNCTION,SCALAR
 
-Implements the ioctl(2) function.  You'll probably have to say
+Implements the ioctl(2) function.  You'll probably first have to say
 
     require "ioctl.ph";        # probably in /usr/local/lib/perl/ioctl.ph
 
-first to get the correct function definitions.  If F<ioctl.ph> doesn't
+to get the correct function definitions.  If F<ioctl.ph> doesn't
 exist or doesn't have the correct definitions you'll have to roll your
 own, based on your C header files such as F<E<lt>sys/ioctl.hE<gt>>.
 (There is a Perl script called B<h2ph> that comes with the Perl kit that
@@ -1925,7 +1995,7 @@ Thus Perl returns TRUE on success and FALSE on failure, yet you can
 still easily determine the actual value returned by the operating
 system:
 
-    ($retval = ioctl(...)) || ($retval = -1);
+    $retval = ioctl(...) || -1;
     printf "System returned %d\n", $retval;
 
 The special string "C<0> but true" is exempt from B<-w> complaints
@@ -1933,11 +2003,10 @@ about improper numeric conversions.
 
 =item join EXPR,LIST
 
-Joins the separate strings of LIST into a single string with
-fields separated by the value of EXPR, and returns the string.
-Example:
+Joins the separate strings of LIST into a single string with fields
+separated by the value of EXPR, and returns that new string.  Example:
 
-    $_ = join(':', $login,$passwd,$uid,$gid,$gcos,$home,$shell);
+    $rec = join(':', $login,$passwd,$uid,$gid,$gcos,$home,$shell);
 
 See L</split>.
 
@@ -2019,7 +2088,8 @@ C<continue> block, if any, is not executed:
     }
 
 C<last> cannot be used to exit a block which returns a value such as
-C<eval {}>, C<sub {}> or C<do {}>.
+C<eval {}>, C<sub {}> or C<do {}>, and should not be used to exit
+a grep() or map() operation.
 
 See also L</continue> for an illustration of how C<last>, C<next>, and
 C<redo> work.
@@ -2049,29 +2119,31 @@ If EXPR is omitted, uses C<$_>.
 =item length
 
 Returns the length in characters of the value of EXPR.  If EXPR is
-omitted, returns length of C<$_>.
+omitted, returns length of C<$_>.  Note that this cannot be used on 
+an entire array or hash to find out how many elements these have.
+For that, use C<scalar @array> and C<scalar keys %hash> respectively.
 
 =item link OLDFILE,NEWFILE
 
 Creates a new filename linked to the old filename.  Returns TRUE for
-success, FALSE otherwise.
+success, FALSE otherwise. 
 
 =item listen SOCKET,QUEUESIZE
 
 Does the same thing that the listen system call does.  Returns TRUE if
-it succeeded, FALSE otherwise.  See example in L<perlipc/"Sockets: Client/Server Communication">.
+it succeeded, FALSE otherwise.  See the example in L<perlipc/"Sockets: Client/Server Communication">.
 
 =item local EXPR
 
+You really probably want to be using C<my()> instead, because C<local()> isn't
+what most people think of as "local".  See L<perlsub/"Private Variables
+via my()"> for details.
+
 A local modifies the listed variables to be local to the enclosing
 block, file, or eval.  If more than one value is listed, the list must
 be placed in parentheses.  See L<perlsub/"Temporary Values via local()">
 for details, including issues with tied arrays and hashes.
 
-You really probably want to be using C<my()> instead, because C<local()> isn't
-what most people think of as "local".  See L<perlsub/"Private Variables
-via my()"> for details.
-
 =item localtime EXPR
 
 Converts a time as returned by the time function to a 9-element array
@@ -2083,9 +2155,12 @@ follows:
                                                localtime(time);
 
 All array elements are numeric, and come straight out of a struct tm.
-In particular this means that C<$mon> has the range C<0..11> and C<$wday> has
-the range C<0..6> with sunday as day C<0>.  Also, C<$year> is the number of
-years since 1900, that is, C<$year> is C<123> in year 2023, and I<not> simply the last two digits of the year.
+In particular this means that C<$mon> has the range C<0..11> and C<$wday>
+has the range C<0..6> with sunday as day C<0>.  Also, C<$year> is the
+number of years since 1900, that is, C<$year> is C<123> in year 2023,
+and I<not> simply the last two digits of the year.  If you assume it is,
+then you create non-Y2K-compliant programs--and you wouldn't want to do
+that, would you?
 
 If EXPR is omitted, uses the current time (C<localtime(time)>).
 
@@ -2101,7 +2176,7 @@ locale environment variables appropriately (please see L<perllocale>)
 and try for example:
 
     use POSIX qw(strftime);
-       $now_string = strftime "%a %b %e %H:%M:%S %Y", localtime;
+    $now_string = strftime "%a %b %e %H:%M:%S %Y", localtime;
 
 Note that the C<%a> and C<%b>, the short forms of the day of the week
 and the month of the year, may not necessarily be three characters wide.
@@ -2110,8 +2185,17 @@ and the month of the year, may not necessarily be three characters wide.
 
 =item log
 
-Returns the natural logarithm (base I<e>) of EXPR.  If EXPR is omitted, returns log
-of C<$_>.
+Returns the natural logarithm (base I<e>) of EXPR.  If EXPR is omitted,
+returns log of C<$_>.  To get the log of another base, use basic algebra:
+The base-N log of a number is is equal to the natural log of that number
+divided by the natural log of N.  For example:
+
+    sub log10 {
+       my $n = shift;
+       return log($n)/log(10);
+    } 
+
+See also L</exp> for the inverse operation.
 
 =item lstat FILEHANDLE
 
@@ -2152,11 +2236,12 @@ is just a funny way to write
        $hash{getkey($_)} = $_;
     }
 
-Note that, because C<$_> is a reference into the list value, it can be used
-to modify the elements of the array.  While this is useful and
-supported, it can cause bizarre results if the LIST is not a named
-array.  See also L</grep> for an array composed of those items of the 
-original list for which the BLOCK or EXPR evaluates to true.
+Note that, because C<$_> is a reference into the list value, it can
+be used to modify the elements of the array.  While this is useful and
+supported, it can cause bizarre results if the LIST is not a named array.
+Using a regular C<foreach> loop for this purpose would be clearer in
+most cases.  See also L</grep> for an array composed of those items of
+the original list for which the BLOCK or EXPR evaluates to true.
 
 =item mkdir FILENAME,MODE
 
@@ -2230,7 +2315,8 @@ executed even on discarded lines.  If the LABEL is omitted, the command
 refers to the innermost enclosing loop.
 
 C<next> cannot be used to exit a block which returns a value such as
-C<eval {}>, C<sub {}> or C<do {}>.
+C<eval {}>, C<sub {}> or C<do {}>, and should not be used to exit
+a grep() or map() operation.
 
 See also L</continue> for an illustration of how C<last>, C<next>, and
 C<redo> work.
@@ -2266,7 +2352,8 @@ name of the real filehandle wanted.  If EXPR is omitted, the scalar
 variable of the same name as the FILEHANDLE contains the filename.
 (Note that lexical variables--those declared with C<my()>--will not work
 for this purpose; so if you're using C<my()>, specify EXPR in your call
-to open.)
+to open.)  See L<perlopentut> for a kinder, gentler explanation of opening
+files.
 
 If the filename begins with C<'E<lt>'> or nothing, the file is opened for input.
 If the filename begins with C<'E<gt>'>, the file is truncated and opened for
@@ -2388,7 +2475,6 @@ STDERR:
     print STDOUT "stdout 2\n";
     print STDERR "stderr 2\n";
 
-
 If you specify C<'E<lt>&=N'>, where C<N> is a number, then Perl will do an
 equivalent of C's C<fdopen()> of that file descriptor; this is more
 parsimonious of file descriptors.  For example:
@@ -2484,6 +2570,7 @@ DIRHANDLEs have their own namespace separate from FILEHANDLEs.
 
 Returns the numeric (ASCII or Unicode) value of the first character of EXPR.  If
 EXPR is omitted, uses C<$_>.  For the reverse, see L</chr>.
+See L<utf8> for more about Unicode.
 
 =item pack TEMPLATE,LIST
 
@@ -2567,7 +2654,7 @@ left.
 
 =item *
 
-The C<"a">, C<"A"> and C<"Z"> types gobble just one value, but pack it as a
+The C<"a">, C<"A">, and C<"Z"> types gobble just one value, but pack it as a
 string of length count, padding with nulls or spaces as necessary.  When
 unpacking, C<"A"> strips trailing spaces and nulls, C<"Z"> strips everything
 after the first null, and C<"a"> returns data verbatim.
@@ -2718,18 +2805,20 @@ The same template may generally also be used in unpack().
 =item package NAMESPACE
 
 Declares the compilation unit as being in the given namespace.  The scope
-of the package declaration is from the declaration itself through the end of
-the enclosing block (the same scope as the C<local()> operator).  All further
-unqualified dynamic identifiers will be in this namespace.  A package
-statement affects only dynamic variables--including those you've used
-C<local()> on--but I<not> lexical variables created with C<my()>.  Typically it
-would be the first declaration in a file to be included by the C<require>
-or C<use> operator.  You can switch into a package in more than one place;
-it merely influences which symbol table is used by the compiler for the
-rest of that block.  You can refer to variables and filehandles in other
-packages by prefixing the identifier with the package name and a double
-colon:  C<$Package::Variable>.  If the package name is null, the C<main>
-package as assumed.  That is, C<$::sail> is equivalent to C<$main::sail>.
+of the package declaration is from the declaration itself through the end
+of the enclosing block, file, or eval (the same as the C<my()> operator).
+All further unqualified dynamic identifiers will be in this namespace.
+A package statement affects only dynamic variables--including those
+you've used C<local()> on--but I<not> lexical variables, which are created
+with C<my()>.  Typically it would be the first declaration in a file to
+be included by the C<require> or C<use> operator.  You can switch into a
+package in more than one place; it merely influences which symbol table
+is used by the compiler for the rest of that block.  You can refer to
+variables and filehandles in other packages by prefixing the identifier
+with the package name and a double colon:  C<$Package::Variable>.
+If the package name is null, the C<main> package as assumed.  That is,
+C<$::sail> is equivalent to C<$main::sail> (as well as to C<$main'sail>,
+still seen in older code).
 
 If NAMESPACE is omitted, then there is no current package, and all
 identifiers must be fully qualified or lexicals.  This is stricter
@@ -2758,14 +2847,13 @@ See L<perlvar/$^F>.
 =item pop
 
 Pops and returns the last value of the array, shortening the array by
-1.  Has a similar effect to
+one element.  Has a similar effect to
 
     $tmp = $ARRAY[$#ARRAY--];
 
 If there are no elements in the array, returns the undefined value.
-If ARRAY is omitted, pops the
-C<@ARGV> array in the main program, and the C<@_> array in subroutines, just
-like C<shift()>.
+If ARRAY is omitted, pops the C<@ARGV> array in the main program, and
+the C<@_> array in subroutines, just like C<shift()>.
 
 =item pos SCALAR
 
@@ -2785,20 +2873,20 @@ L<perlop>.
 
 Prints a string or a comma-separated list of strings.  Returns TRUE
 if successful.  FILEHANDLE may be a scalar variable name, in which case
-the variable contains the name of or a reference to the filehandle, thus introducing one
-level of indirection.  (NOTE: If FILEHANDLE is a variable and the next
-token is a term, it may be misinterpreted as an operator unless you
-interpose a C<+> or put parentheses around the arguments.)  If FILEHANDLE is
-omitted, prints by default to standard output (or to the last selected
-output channel--see L</select>).  If LIST is also omitted, prints C<$_> to
-the currently selected output channel.  To set the default output channel to something other than
-STDOUT use the select operation.  Note that, because print takes a
-LIST, anything in the LIST is evaluated in list context, and any
-subroutine that you call will have one or more of its expressions
-evaluated in list context.  Also be careful not to follow the print
-keyword with a left parenthesis unless you want the corresponding right
-parenthesis to terminate the arguments to the print--interpose a C<+> or
-put parentheses around all the arguments.
+the variable contains the name of or a reference to the filehandle, thus
+introducing one level of indirection.  (NOTE: If FILEHANDLE is a variable
+and the next token is a term, it may be misinterpreted as an operator
+unless you interpose a C<+> or put parentheses around the arguments.)
+If FILEHANDLE is omitted, prints by default to standard output (or to the
+last selected output channel--see L</select>).  If LIST is also omitted,
+prints C<$_> to the currently selected output channel.  To set the default
+output channel to something other than STDOUT use the select operation.
+Note that, because print takes a LIST, anything in the LIST is evaluated
+in list context, and any subroutine that you call will have one or
+more of its expressions evaluated in list context.  Also be careful
+not to follow the print keyword with a left parenthesis unless you want
+the corresponding right parenthesis to terminate the arguments to the
+print--interpose a C<+> or put parentheses around all the arguments.
 
 Note that if you're storing FILEHANDLES in an array or other expression,
 you will have to use a block returning its value instead:
@@ -2826,12 +2914,12 @@ Returns the prototype of a function as a string (or C<undef> if the
 function has no prototype).  FUNCTION is a reference to, or the name of,
 the function whose prototype you want to retrieve.
 
-If FUNCTION is a string starting with C<CORE::>, the rest is taken as
-a name for Perl builtin.  If builtin is not I<overridable> (such as
+If FUNCTION is a string starting with C<CORE::>, the rest is taken as a
+name for Perl builtin.  If the builtin is not I<overridable> (such as
 C<qw//>) or its arguments cannot be expressed by a prototype (such as
-C<system()>) - in other words, the builtin does not behave like a Perl
-function - returns C<undef>.  Otherwise, the string describing the
-equivalent prototype is returned.
+C<system()>) returns C<undef> because the builtin does not really behave
+like a Perl function.  Otherwise, the string describing the equivalent
+prototype is returned.
 
 =item push ARRAY,LIST
 
@@ -2919,9 +3007,9 @@ reads until end-of-file is reached and returns a list of lines.  Note that
 the notion of "line" used here is however you may have defined it
 with C<$/> or C<$INPUT_RECORD_SEPARATOR>).  See L<perlvar/"$/">.
 
-When C<$/> is set to C<undef> and when readline() is in a scalar
-context (i.e. file slurp mode), it returns C<''> the first time,
-followed by C<undef> subsequently.
+When C<$/> is set to C<undef>, when readline() is in scalar
+context (i.e. file slurp mode), and when an empty file is read, it
+returns C<''> the first time, followed by C<undef> subsequently.
 
 This is the internal function implementing the C<E<lt>EXPRE<gt>>
 operator, but you can use it directly.  The C<E<lt>EXPRE<gt>>
@@ -2988,7 +3076,8 @@ themselves about what was just input:
     }
 
 C<redo> cannot be used to retry a block which returns a value such as
-C<eval {}>, C<sub {}> or C<do {}>.
+C<eval {}>, C<sub {}> or C<do {}>, and should not be used to exit
+a grep() or map() operation.
 
 See also L</continue> for an illustration of how C<last>, C<next>, and
 C<redo> work.
@@ -3015,16 +3104,24 @@ name is returned instead.  You can think of C<ref()> as a C<typeof()> operator.
     if (ref($r) eq "HASH") {
        print "r is a reference to a hash.\n";
     }
-    if (!ref($r)) {
+    unless (ref($r)) {
        print "r is not a reference at all.\n";
     }
+    if (UNIVERSAL::isa($r, "HASH")) {  # for subclassing
+       print "r is a reference to something that isa hash.\n";
+    } 
 
 See also L<perlref>.
 
 =item rename OLDNAME,NEWNAME
 
-Changes the name of a file.  Returns C<1> for success, C<0> otherwise.  Will
-not work across file system boundaries.
+Changes the name of a file.  Returns C<1> for success, C<0> otherwise.
+Behavior of this function varies wildly depending on your system
+implementation.  For example, it will usually not work across file system
+boundaries, even though the system I<mv> command sometimes compensates
+for this.  Other restrictions include whether it works on directories,
+open files, or pre-existing files.  Check L<perlport> and either the
+rename(2) manpage or equivalent system documentation for details.
 
 =item require EXPR
 
@@ -3107,12 +3204,13 @@ only variables or searches in the current package.  Always returns
 
     reset 'X';         # reset all X variables
     reset 'a-z';       # reset lower case variables
-    reset;             # just reset ?? searches
+    reset;             # just reset ?one-time? searches
 
 Resetting C<"A-Z"> is not recommended because you'll wipe out your
-C<@ARGV> and C<@INC> arrays and your C<%ENV> hash.  Resets only package variables--lexical variables
-are unaffected, but they clean themselves up on scope exit anyway,
-so you'll probably want to use them instead.  See L</my>.
+C<@ARGV> and C<@INC> arrays and your C<%ENV> hash.  Resets only package
+variables--lexical variables are unaffected, but they clean themselves
+up on scope exit anyway, so you'll probably want to use them instead.
+See L</my>.
 
 =item return EXPR
 
@@ -3122,17 +3220,18 @@ Returns from a subroutine, C<eval()>, or C<do FILE> with the value
 given in EXPR.  Evaluation of EXPR may be in list, scalar, or void
 context, depending on how the return value will be used, and the context
 may vary from one execution to the next (see C<wantarray()>).  If no EXPR
-is given, returns an empty list in list context, an undefined value in
-scalar context, or nothing in a void context.
+is given, returns an empty list in list context, the undefined value in
+scalar context, and (of course) nothing at all in a void context.
 
-(Note that in the absence of a return, a subroutine, eval, or do FILE
-will automatically return the value of the last expression evaluated.)
+(Note that in the absence of a explicit C<return>, a subroutine, eval,
+or do FILE will automatically return the value of the last expression
+evaluated.)
 
 =item reverse LIST
 
 In list context, returns a list value consisting of the elements
 of LIST in the opposite order.  In scalar context, concatenates the
-elements of LIST, and returns a string value with all the characters
+elements of LIST and returns a string value with all characters
 in the opposite order.
 
     print reverse <>;          # line tac, last line first
@@ -3144,7 +3243,7 @@ This operator is also handy for inverting a hash, although there are some
 caveats.  If a value is duplicated in the original hash, only one of those
 can be represented as a key in the inverted hash.  Also, this has to
 unwind one hash and build a whole new one, which may take some time
-on a large hash.
+on a large hash, such as from a DBM file.
 
     %by_name = reverse %by_address;    # Invert the hash
 
@@ -3157,7 +3256,7 @@ C<readdir()> routine on DIRHANDLE.
 
 =item rindex STR,SUBSTR
 
-Works just like index except that it returns the position of the LAST
+Works just like index() except that it returns the position of the LAST
 occurrence of SUBSTR in STR.  If POSITION is specified, returns the
 last occurrence at or before that position.
 
@@ -3181,16 +3280,15 @@ of EXPR.
     @counts = ( scalar @a, scalar @b, scalar @c );
 
 There is no equivalent operator to force an expression to
-be interpolated in list context because it's in practice never
+be interpolated in list context because in practice, this is never
 needed.  If you really wanted to do so, however, you could use
 the construction C<@{[ (some expression) ]}>, but usually a simple
 C<(some expression)> suffices.
 
-Though C<scalar> can be considered in general to be a unary operator,
-EXPR is also allowed to be a parenthesized list.  The list in fact
-behaves as a scalar comma expression, evaluating all but the last
-element in void context and returning the final element evaluated in
-a scalar context.
+Wince C<scalar> is unary operator, if you accidentally use for EXPR a
+parenthesized list, this behaves as a scalar comma expression, evaluating
+all but the last element in void context and returning the final element
+evaluated in scalar context.  This is seldom what you want.
 
 The following single statement:
 
@@ -3217,10 +3315,10 @@ If you want to position file for C<sysread()> or C<syswrite()>, don't use
 C<seek()> -- buffering makes its effect on the file's system position
 unpredictable and non-portable.  Use C<sysseek()> instead.
 
-On some systems you have to do a seek whenever you switch between reading
-and writing.  Amongst other things, this may have the effect of calling
-stdio's clearerr(3).  A WHENCE of C<1> (C<SEEK_CUR>) is useful for not moving
-the file position:
+Due to the rules and rigors of ANSI C, on some systems you have to do a
+seek whenever you switch between reading and writing.  Amongst other
+things, this may have the effect of calling stdio's clearerr(3).
+A WHENCE of C<1> (C<SEEK_CUR>) is useful for not moving the file position:
 
     seek(TEST,0,1);
 
@@ -3367,7 +3465,7 @@ Sends a message on a socket.  Takes the same flags as the system call
 of the same name.  On unconnected sockets you must specify a
 destination to send TO, in which case it does a C C<sendto()>.  Returns
 the number of characters sent, or the undefined value if there is an
-error.
+error.  The C system call sendmsg(2) is currently unimplemented.
 See L<perlipc/"UDP: Message Passing"> for examples.
 
 =item setpgrp PID,PGRP
@@ -3376,7 +3474,7 @@ Sets the current process group for the specified PID, C<0> for the current
 process.  Will produce a fatal error if used on a machine that doesn't
 implement setpgrp(2).  If the arguments are omitted, it defaults to
 C<0,0>.  Note that the POSIX version of C<setpgrp()> does not accept any
-arguments, so only setpgrp C<0,0> is portable.
+arguments, so only C<setpgrp(0,0)> is portable.  See also C<POSIX::setsid()>.
 
 =item setpriority WHICH,WHO,PRIORITY
 
@@ -3432,7 +3530,8 @@ detaching from it.  When reading, VAR must be a variable that will
 hold the data read.  When writing, if STRING is too long, only SIZE
 bytes are used; if STRING is too short, nulls are written to fill out
 SIZE bytes.  Return TRUE if successful, or FALSE if there is an error.
-See also C<IPC::SysV> documentation.
+See also C<IPC::SysV> documentation and the C<IPC::Shareable> module
+from CPAN.
 
 =item shutdown SOCKET,HOW
 
@@ -3488,7 +3587,7 @@ See also the POSIX module's C<sigpause()> function.
 Opens a socket of the specified kind and attaches it to filehandle
 SOCKET.  DOMAIN, TYPE, and PROTOCOL are specified the same as for the
 system call of the same name.  You should "C<use Socket;>" first to get
-the proper definitions imported.  See the example in L<perlipc/"Sockets: Client/Server Communication">.
+the proper definitions imported.  See the examples in L<perlipc/"Sockets: Client/Server Communication">.
 
 =item socketpair SOCKET1,SOCKET2,DOMAIN,TYPE,PROTOCOL
 
@@ -3828,7 +3927,11 @@ See L<perllocale>.
 =item sqrt
 
 Return the square root of EXPR.  If EXPR is omitted, returns square
-root of C<$_>.
+root of C<$_>.  Only works on non-negative operands, unless you've
+loaded the standard Math::Complex module.
+
+    use Math::Complex;
+    print sqrt(-2);    # prints 1.4142135623731i
 
 =item srand EXPR
 
@@ -3918,10 +4021,26 @@ last stat or filetest are returned.  Example:
 
 (This works on machines only for which the device number is negative under NFS.)
 
+Because the mode contains both the file type and its permissions, you
+should mask off the file type portion and (s)printf using a C<"%o"> 
+if you want to see the real permissions.
+
+    $mode = (stat($filename))[2];
+    printf "Permissions are %04o\n", $mode & 07777;
+
+
 In scalar context, C<stat()> returns a boolean value indicating success
 or failure, and, if successful, sets the information associated with
 the special filehandle C<_>.
 
+The File::stat module provides a convenient, by-name access mechanism:
+
+    use File::stat;
+    $sb = stat($filename);
+    printf "File is %s, size is %s, perm %04o, mtime %s\n", 
+       $filename, $sb->size, $sb->mode & 07777,
+       scalar localtime $sb->mtime;
+
 =item study SCALAR
 
 =item study
@@ -3947,9 +4066,9 @@ before any line containing a certain pattern:
 
     while (<>) {
        study;
-       print ".IX foo\n" if /\bfoo\b/;
-       print ".IX bar\n" if /\bbar\b/;
-       print ".IX blurfl\n" if /\bblurfl\b/;
+       print ".IX foo\n"       if /\bfoo\b/;
+       print ".IX bar\n"       if /\bbar\b/;
+       print ".IX blurfl\n"    if /\bblurfl\b/;
        # ...
        print;
     }
@@ -4010,16 +4129,16 @@ If you specify a substring that is partly outside the string, the part
 within the string is returned.    If the substring is totally outside
 the string a warning is produced.
 
-You can use the C<substr()> function
-as an lvalue, in which case EXPR must be an lvalue.  If you assign
-something shorter than LEN, the string will shrink, and if you assign
-something longer than LEN, the string will grow to accommodate it.  To
-keep the string the same length you may need to pad or chop your value
-using C<sprintf()>.
+You can use the substr() function as an lvalue, in which case EXPR
+must itself be an lvalue.  If you assign something shorter than LEN,
+the string will shrink, and if you assign something longer than LEN,
+the string will grow to accommodate it.  To keep the string the same
+length you may need to pad or chop your value using C<sprintf()>.
 
-An alternative to using C<substr()> as an lvalue is to specify the
+An alternative to using substr() as an lvalue is to specify the
 replacement string as the 4th argument.  This allows you to replace
-parts of the EXPR and return what was there before in one operation.
+parts of the EXPR and return what was there before in one operation,
+just as you can with splice().
 
 =item symlink OLDFILE,NEWFILE
 
@@ -4028,7 +4147,7 @@ Returns C<1> for success, C<0> otherwise.  On systems that don't support
 symbolic links, produces a fatal error at run time.  To check for that,
 use eval:
 
-    $symlink_exists =  eval { symlink("",""); 1 };
+    $symlink_exists = eval { symlink("",""); 1 };
 
 =item syscall LIST
 
@@ -4089,12 +4208,12 @@ the PERMS argument to C<sysopen()>, Perl uses the octal value C<0666>.
 These permission values need to be in octal, and are modified by your
 process's current C<umask>.
 
-Seldom if ever use C<0644> as argument to C<sysopen()> because that
-takes away the user's option to have a more permissive umask.  Better
-to omit it.  See the perlfunc(1) entry on C<umask> for more on this.
+You should seldom if ever use C<0644> as argument to C<sysopen()>, because
+that takes away the user's option to have a more permissive umask.
+Better to omit it.  See the perlfunc(1) entry on C<umask> for more
+on this.
 
-The C<IO::File> module provides a more object-oriented approach, if you're
-into that kind of thing.
+See L<perlopentut> for a kinder, gentler explanation of opening files.
 
 =item sysread FILEHANDLE,SCALAR,LENGTH,OFFSET
 
@@ -4116,6 +4235,10 @@ string.  A positive OFFSET greater than the length of SCALAR results
 in the string being padded to the required size with C<"\0"> bytes before
 the result of the read is appended.
 
+There is no syseof() function, which is ok, since eof() doesn't work
+very well on device files (like ttys) anyway.  Use sysread() and check
+ofr a return value for 0 to decide whether you're done.
+
 =item sysseek FILEHANDLE,POSITION,WHENCE
 
 Sets FILEHANDLE's system position using the system call lseek(2).  It
@@ -4137,7 +4260,7 @@ the new position.
 
 =item system PROGRAM LIST
 
-Does exactly the same thing as "C<exec LIST>" except that a fork is done
+Does exactly the same thing as "C<exec LIST>", except that a fork is done
 first, and the parent process waits for the child process to complete.
 Note that argument processing varies depending on the number of
 arguments.  If there is more than one argument in LIST, or if LIST is
@@ -4204,7 +4327,9 @@ case the SCALAR is empty you can use OFFSET but only zero offset.
 
 Returns the current position for FILEHANDLE.  FILEHANDLE may be an
 expression whose value gives the name of the actual filehandle.  If
-FILEHANDLE is omitted, assumes the file last read.
+FILEHANDLE is omitted, assumes the file last read.  
+
+There is no C<systell()> function.  Use C<sysseek(FH, 0, 1)> for that.
 
 =item telldir DIRHANDLE
 
@@ -4285,7 +4410,7 @@ A class implementing a scalar should have the following methods:
     DESTROY this
 
 Not all methods indicated above need be implemented.  See L<perltie>,
-L<Tie::Hash>, L<Tie::Array>, L<Tie::Scalar> and L<Tie::Handle>.
+L<Tie::Hash>, L<Tie::Array>, L<Tie::Scalar>, and L<Tie::Handle>.
 
 Unlike C<dbmopen()>, the C<tie()> function will not use or require a module
 for you--you need to do that explicitly yourself.  See L<DB_File>
@@ -4346,7 +4471,8 @@ If EXPR is omitted, uses C<$_>.
 Returns the value of EXPR with the first character
 in uppercase (titlecase in Unicode).  This is
 the internal function implementing the C<\u> escape in double-quoted strings.
-Respects current LC_CTYPE locale if C<use locale> in force.  See L<perllocale>.
+Respects current LC_CTYPE locale if C<use locale> in force.  See L<perllocale>
+and L<utf8>.
 
 If EXPR is omitted, uses C<$_>.
 
@@ -4387,8 +4513,6 @@ not trying to restrict access for yourself, returns C<undef>.
 Remember that a umask is a number, usually given in octal; it is I<not> a
 string of octal digits.  See also L</oct>, if all you have is a string.
 
-
-
 =item undef EXPR
 
 =item undef
@@ -4578,8 +4702,15 @@ subject to change in future versions of perl, but it is guaranteed to
 be the same order as either the C<keys()> or C<each()> function would
 produce on the same (unmodified) hash.
 
-As a side effect, it resets HASH's iterator.  See also C<keys()>, C<each()>,
-and C<sort()>.
+Note that you cannot modify the values of a hash this way, because the
+returned list is just a copy.  You need to use a hash slice for that, 
+since it's lvaluable in a way that values() is not.
+
+    for (values %hash)             { s/foo/bar/g }   # FAILS!
+    for (@hash{keys %hash}) { s/foo/bar/g }   # ok
+
+As a side effect, calling values() resets the HASH's internal iterator.
+See also C<keys()>, C<each()>, and C<sort()>.
 
 =item vec EXPR,OFFSET,BITS
 
@@ -4594,7 +4725,7 @@ the correct precedence as in
 
 Vectors created with C<vec()> can also be manipulated with the logical
 operators C<|>, C<&>, and C<^>, which will assume a bit vector operation is
-desired when both operands are strings.
+desired when both operands are strings.  See L<perlop/"Bitwise String Operators">.
 
 The following code will build up an ASCII string saying C<'PerlPerlPerl'>.
 The comments show the string after each step. Note that this code works
@@ -4623,30 +4754,35 @@ If you know the exact length in bits, it can be used in place of the C<*>.
 
 =item wait
 
-Waits for a child process to terminate and returns the pid of the
-deceased process, or C<-1> if there are no child processes.  The status is
-returned in C<$?>.  Note that a return value of C<-1> could mean that
-child processes are being automatically reaped, as described in L<perlipc>.
+Behaves like the wait(2) system call on your system: it waits for a child
+process to terminate and returns the pid of the deceased process, or
+C<-1> if there are no child processes.  The status is rketurned in C<$?>.
+Note that a return value of C<-1> could mean that child processes are
+being automatically reaped, as described in L<perlipc>.
 
 =item waitpid PID,FLAGS
 
-Waits for a particular child process to terminate and returns the pid
-of the deceased process, or C<-1> if there is no such child process.  The
-status is returned in C<$?>.  If you say
+Waits for a particular child process to terminate and returns the pid of
+the deceased process, or C<-1> if there is no such child process.  On some
+systems, a value of 0 indicates that there are processes still running.
+The status is returned in C<$?>.  If you say
 
     use POSIX ":sys_wait_h";
     #...
-    waitpid(-1,&WNOHANG);
+    do { 
+       $kid = waitpid(-1,&WNOHANG);
+    } until $kid == -1;
 
-then you can do a non-blocking wait for any process.  Non-blocking wait
-is available on machines supporting either the waitpid(2) or
-wait4(2) system calls.  However, waiting for a particular pid with
-FLAGS of C<0> is implemented everywhere.  (Perl emulates the system call
-by remembering the status values of processes that have exited but have
-not been harvested by the Perl script yet.)
+then you can do a non-blocking wait for all pending zombie processes.
+Non-blocking wait is available on machines supporting either the
+waitpid(2) or wait4(2) system calls.  However, waiting for a particular
+pid with FLAGS of C<0> is implemented everywhere.  (Perl emulates the
+system call by remembering the status values of processes that have
+exited but have not been harvested by the Perl script yet.)
 
-Note that a return value of C<-1> could mean that child processes are being
-automatically reaped.  See L<perlipc> for details, and for other examples.
+Note that on some systems, a return value of C<-1> could mean that child
+processes are being automatically reaped.  See L<perlipc> for details,
+and for other examples.
 
 =item wantarray
 
@@ -4699,7 +4835,8 @@ warnings (even the so-called mandatory ones).  An example:
     warn "\$foo is alive and $foo!";     # does show up
 
 See L<perlvar> for details on setting C<%SIG> entries, and for more
-examples.
+examples.  See the Carp module for other kinds of warnings using its
+carp() and cluck() functions.
 
 =item write FILEHANDLE
 
index dfb893d..313ed58 100644 (file)
@@ -1521,7 +1521,8 @@ security concerns.)
 In a scalar context, evaluating a filehandle in angle brackets yields the
 next line from that file (newline, if any, included), or C<undef> at
 end-of-file.  When C<$/> is set to C<undef> (i.e. file slurp mode),
-it returns C<''> the first time, followed by C<undef> subsequently.
+and the file is empty, it returns C<''> the first time, followed by
+C<undef> subsequently.
 
 Ordinarily you must assign the returned value to a variable, but there is one
 situation where an automatic assignment happens.  I<If and ONLY if> the
index ef5a3c5..3a53573 100644 (file)
@@ -864,8 +864,10 @@ unbackslashed C<@> or C<%> eats all the rest of the arguments, and forces
 list context.  An argument represented by C<$> forces scalar context.  An
 C<&> requires an anonymous subroutine, which, if passed as the first
 argument, does not require the "C<sub>" keyword or a subsequent comma.  A
-C<*> does whatever it has to do to turn the argument into a reference to a
-symbol table entry.
+C<*> allows the subroutine to accept a bareword, constant, scalar expression,
+typeglob, or a reference to a typeglob in that slot.  The value will be
+available to the subroutine either as a simple scalar, or (in the latter
+two cases) as a reference to the typeglob.
 
 A semicolon separates mandatory arguments from optional arguments.
 (It is redundant before C<@> or C<%>.)
index fd2c244..fe339de 100644 (file)
@@ -90,12 +90,6 @@ slower, and see if there's a way to make them faster.
 
 =back
 
-=head2 Filenames
-
-Make filenames in the distribution and in the standard module set
-be 8.3 friendly where feasible.  Good luck changing the standard
-modules, though.  B<Done>.
-
 =head1 Configure
 
 Andy Dougherty maintain(ed|s) a list of "todo" items for the configure
@@ -162,21 +156,12 @@ setuid environments.  Decide between Glob::BSD and File::KGlob, move
 it into the core, and make Perl use it for globbing.  Ben Holzman and
 Tye McQueen have claimed the pumpkin for this.
 
-=head2 Proper tied array support
-
-This was B<done> in 5.005 by Nick Ing-Simmons.
-
 =head1 Perl Internals
 
 =head2 magic_setisa
 
 C<magic_setisa> should be made to update %FIELDS [???]
 
-=head2 Foreign lines
-
-Perl should be more generous in accepting foreign line terminations.
-Mostly B<done> in 5.005.
-
 =head2 Garbage Collection
 
 There was talk of a mark-and-sweep garbage collector at TPC2, but the
@@ -249,13 +234,7 @@ will be difficult.
 
 =head2 Namespace cleanup
 
-    symbol-space: "pl_" prefix for all global vars
-                  "Perl_" prefix for all functions
-
-B<Done>.
-
-    CPP-space:   restrict what we export from headers
-                  stop malloc()/free() pollution unless asked
+    CPP-space:    restrict CPP symbols exported from headers
     header-space: move into CORE/perl/
     API-space:    begin list of things that constitute public api
 
@@ -412,6 +391,11 @@ to be that, but no longer.  The things in perldelta never seemed to
 get placed in the right places in the real manpages, either.  This
 needs work.
 
+=head2 Adapt www.linuxhq.com for Perl
+
+This should help glorify documentation and get more people involved in
+perl development.
+
 =head2 Replace man with a perl program
 
 Can we reimplement man in Perl?  Tom has a start.  I believe some of
@@ -423,11 +407,6 @@ perldoc to remove the unfeatures like "is slow" and "has no apropos".
 We could use more work on helping people understand Perl's new
 Unicode support that Larry has created.
 
-=head2 Explain tool
-
-Given a piece of Perl code, say what it does.  B::Deparse is doing
-this.  B<Done>.
-
 =head1 Modules
 
 =head2 Update the POSIX extension to conform with the POSIX 1003.1 Edition 2
@@ -448,10 +427,6 @@ that we should be including?
 Which modules should be added to the standard distribution?  This ties
 in with the SDK discussed on the perl-sdk list at perl.org.
 
-=head2 ISA.pm
-
-Rename and alter ISA.pm.  B<Done>.  It is now base.pm.
-
 =head2 Profiler
 
 Make the profiler (Devel::DProf) part of the standard release, and
@@ -480,14 +455,6 @@ Defines shift et al in terms of splice method
 
 =back
 
-=head2 Exceptions
-
-Figure out a coherent exception model, and implement it.  Graham's
-Error.pm is an OO module that (I believe) requires core support.
-Are objects the right basis for this?  Can it be done using the same
-text that the rest of Perl works on?  The builtins will need to agree
-on a system.
-
 =head2 Procedural options
 
 Support procedural interfaces for the common cases of Perl's
@@ -622,10 +589,6 @@ pointed out that perllib_mangle() is good for this.
 
 =head1 Win32 Stuff
 
-=head2 Automate maintenance of most PERL_OBJECT code
-
-B<Done>, says Sarathy.
-
 =head2 Get PERL_OBJECT building under gcc
 
 B<Part done>, according to Sarathy.  It builds under egcs on win32,
@@ -656,16 +619,8 @@ breed of chicken to sacrifice, please speak up.
 
 =item Use posix calls internally where possible
 
-=item gettimeofday
-
-Joshua Pritikin sent patches to p5p in early December 1998.
-
 =item format BOTTOM
 
-=item -iprefix.
-
-Added in 5.004_70.  B<Done>
-
 =item -i rename file only when successfully changed
 
 =item All ARGV input should act like <>
@@ -674,10 +629,6 @@ Added in 5.004_70.  B<Done>
 
 =item support in perlmain to rerun debugger
 
-=item reference to compiled regexp
-
-B<done>  This is the qr// support in 5.005.
-
 =item lvalue functions
 
 Tuomas Lukka, on behalf of the PDL project, greatly desires this and
@@ -697,16 +648,6 @@ not just subs.
 
 =head2 constant function cache
 
-=head2 eval qw() at compile time
-
-qw() is presently compiled as a call to split.  This means the split
-happens at runtime.  Change this so qw() is compiled as a real list
-assignment.  This also avoids surprises like:
-
-    $a = () = qw(What will $a hold?);
-
-B<Done>.  Tom Hughes submitted a patch that went into 5.005_55.
-
 =head2 foreach(reverse...)
 
 =head2 Cache eval tree
@@ -756,12 +697,6 @@ with syntax, please.
 
 =item structured types
 
-=item autocroak?
-
-B<Done>.  This is the Fatal.pm module, so any builtin that that does
-not return success automatically die()s.  If you're feeling brave, tie
-this in with the unified exceptions scheme.
-
 =item Modifiable $1 et al
 
 The intent is for this to be a means of editing the matched portions of
@@ -793,31 +728,15 @@ which is almost (but not):
 
 but if the first argument was given and is "0", then it will be
 considered false by C<||> and C<5> used instead.  Really we want
-an C<||>-like construct that behaves like:
+an C<||>-like operator that behaves like:
 
     $children = shift;
     $children = 5 unless defined $children;
 
-Namely, a C<||> that tests defined-ness rather than truth.  One
-was discussed, and a patch submitted, but the objections were many:
-
-=over 4
-
-=item Punctuation
-
-We're running out of punctuation.  C<|||>, the suggested operator, is
-very very verbose.
-
-=item Orthogonality
-
-To work like the other logical operators, there'd need to be C<|||=>
-and "English" equivalents (as there is "or" for "||").  We couldn't
-settle on an equivalent we liked.  Does there also have to be an "&&"
-that tests truth?
-
-=back
-
-While there were objections, many still feel the need.
+Namely, a C<||> that tests defined-ness rather than truth.  One was
+discussed, and a patch submitted, but the objections were many.  While
+there were objections, many still feel the need.  At least it was
+decided that C<??> is the best name for the operator.
 
 =head2 "dynamic" lexicals
 
@@ -901,10 +820,6 @@ Typed lexicals should affect B::CC::load_pad.
 
 Workarounds to help Win32 dynamic loading.
 
-=head2 Status variable
-
-$^C to track compiler/checker status.  B<Done> in 5.005_54.
-
 =head2 END blocks
 
 END blocks need saving in compiled output.
@@ -922,4 +837,73 @@ from where newASSIGNOP steals the field).
 
 Can we install modules as bytecode?
 
+=head1 Recently Finished Tasks
+
+=head2 Filenames
+
+Make filenames in the distribution and in the standard module set
+be 8.3 friendly where feasible.  Good luck changing the standard
+modules, though.  B<Done>.
+
+=head2 Proper tied array support
+
+This was B<done> in 5.005 by Nick Ing-Simmons.
+
+=head2 Foreign lines
+
+Perl should be more generous in accepting foreign line terminations.
+Mostly B<done> in 5.005.
+
+=head2 Namespace cleanup
+
+    symbol-space: "pl_" prefix for all global vars
+                  "Perl_" prefix for all functions
+
+    CPP-space:   stop malloc()/free() pollution unless asked
+
+=head2 Explain tool
+
+Given a piece of Perl code, say what it does.  B::Deparse is doing
+this.  B<Done>.
+
+=head2 ISA.pm
+
+Rename and alter ISA.pm.  B<Done>.  It is now base.pm.
+
+=head2 Automate maintenance of most PERL_OBJECT code
+
+B<Done>, says Sarathy.
+
+=head2 -iprefix.
+
+Added in 5.004_70.  B<Done>
+
+=head2 gettimeofday
+
+See Time::HiRes.
+
+=head2 reference to compiled regexp
+
+B<done>  This is the qr// support in 5.005.
+
+=head2 eval qw() at compile time
+
+qw() is presently compiled as a call to split.  This means the split
+happens at runtime.  Change this so qw() is compiled as a real list
+assignment.  This also avoids surprises like:
+
+    $a = () = qw(What will $a hold?);
+
+B<Done>.  Tom Hughes submitted a patch that went into 5.005_55.
+
+=head2 autocroak?
+
+B<Done>.  This is the Fatal.pm module, so any builtin that that does
+not return success automatically die()s.  If you're feeling brave, tie
+this in with the unified exceptions scheme.
+
+=head2 Status variable
+
+$^C to track compiler/checker status.  B<Done> in 5.005_54.
+
 =cut
index 52fcf96..df2a962 100644 (file)
--- a/pp_ctl.c
+++ b/pp_ctl.c
@@ -2619,7 +2619,7 @@ doeval(int gimme, OP** startop)
     SAVESPTR(PL_compcv);
     PL_compcv = (CV*)NEWSV(1104,0);
     sv_upgrade((SV *)PL_compcv, SVt_PVCV);
-    CvUNIQUE_on(PL_compcv);
+    CvEVAL_on(PL_compcv);
 #ifdef USE_THREADS
     CvOWNER(PL_compcv) = 0;
     New(666, CvMUTEXP(PL_compcv), 1, perl_mutex);
index b1bf270..3ab4f30 100644 (file)
--- a/pp_hot.c
+++ b/pp_hot.c
@@ -855,7 +855,7 @@ PP(pp_match)
     register char *s;
     char *strend;
     I32 global;
-    I32 r_flags;
+    I32 r_flags = 0;
     char *truebase;
     register REGEXP *rx = pm->op_pmregexp;
     bool rxtainted;
@@ -904,14 +904,18 @@ PP(pp_match)
            if (mg && mg->mg_len >= 0) {
                if (!(rx->reganch & ROPT_GPOS_SEEN))
                    rx->endp[0] = rx->startp[0] = s + mg->mg_len; 
+               else if (rx->reganch & ROPT_ANCH_GPOS) {
+                   r_flags |= REXEC_IGNOREPOS;
+                   rx->endp[0] = rx->startp[0] = s + mg->mg_len; 
+               }
                minmatch = (mg->mg_flags & MGf_MINMATCH);
                update_minmatch = 0;
            }
        }
     }
-    r_flags = ((gimme != G_ARRAY && !global && rx->nparens)
-               || SvTEMP(TARG) || PL_sawampersand)
-               ? REXEC_COPY_STR : 0;
+    if ((gimme != G_ARRAY && !global && rx->nparens)
+           || SvTEMP(TARG) || PL_sawampersand)
+       r_flags |= REXEC_COPY_STR;
     if (SvSCREAM(TARG) && rx->check_substr
        && SvTYPE(rx->check_substr) == SVt_PVBM
        && SvVALID(rx->check_substr)) 
index 5d4c0f0..0872c2c 100644 (file)
--- a/regcomp.c
+++ b/regcomp.c
@@ -172,7 +172,8 @@ typedef struct {
 } scan_data_t;
 #endif
 
-static scan_data_t zero_scan_data = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
+static scan_data_t zero_scan_data = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
+                                     0, 0, 0 };
 
 #define SF_BEFORE_EOL          (SF_BEFORE_SEOL|SF_BEFORE_MEOL)
 #define SF_BEFORE_SEOL         0x1
@@ -1171,10 +1172,10 @@ reg(I32 paren, I32 *flagp)
 
                    rop = sv_compile_2op(sv, &sop, "re", &av);
 
-                   n = add_data(3, "nso");
+                   n = add_data(3, "nop");
                    PL_regcomp_rx->data->data[n] = (void*)rop;
-                   PL_regcomp_rx->data->data[n+1] = (void*)av;
-                   PL_regcomp_rx->data->data[n+2] = (void*)sop;
+                   PL_regcomp_rx->data->data[n+1] = (void*)sop;
+                   PL_regcomp_rx->data->data[n+2] = (void*)av;
                    SvREFCNT_dec(sv);
                }
                else {                                          /* First pass */
@@ -3123,13 +3124,30 @@ pregfree(struct regexp *r)
     }
     if (r->data) {
        int n = r->data->count;
+       AV* new_comppad = NULL;
+       AV* old_comppad;
+       SV** old_curpad;
+
        while (--n >= 0) {
            switch (r->data->what[n]) {
            case 's':
                SvREFCNT_dec((SV*)r->data->data[n]);
                break;
+           case 'p':
+               new_comppad = (AV*)r->data->data[n];
+               break;
            case 'o':
+               if (new_comppad == NULL)
+                   croak("panic: pregfree comppad");
+               old_comppad = PL_comppad;
+               old_curpad = PL_curpad;
+               PL_comppad = new_comppad;
+               PL_curpad = AvARRAY(new_comppad);
                op_free((OP_4tree*)r->data->data[n]);
+               PL_comppad = old_comppad;
+               PL_curpad = old_curpad;
+               SvREFCNT_dec((SV*)new_comppad);
+               new_comppad = NULL;
                break;
            case 'n':
                break;
index f53567e..6d0cf8d 100644 (file)
--- a/regexec.c
+++ b/regexec.c
@@ -1664,7 +1664,7 @@ regmatch(regnode *prog)
            n = ARG(scan);
            PL_op = (OP_4tree*)PL_regdata->data[n];
            DEBUG_r( PerlIO_printf(Perl_debug_log, "  re_eval 0x%x\n", PL_op) );
-           PL_curpad = AvARRAY((AV*)PL_regdata->data[n + 1]);
+           PL_curpad = AvARRAY((AV*)PL_regdata->data[n + 2]);
            PL_reg_magic->mg_len = locinput - PL_bostr;
            PL_regendp[0] = locinput;
 
diff --git a/sv.c b/sv.c
index acc8ae5..8a0334e 100644 (file)
--- a/sv.c
+++ b/sv.c
@@ -2730,6 +2730,14 @@ sv_clear(register SV *sv)
            } while (SvOBJECT(sv) && SvSTASH(sv) != stash);
 
            del_XRV(SvANY(&tmpref));
+
+           if (SvREFCNT(sv)) {
+               if (PL_in_clean_objs)
+                   croak("DESTROY created new reference to dead object '%s'",
+                         HvNAME(stash));
+               /* DESTROY gave object new lease on life */
+               return;
+           }
        }
 
        if (SvOBJECT(sv)) {
@@ -2738,12 +2746,6 @@ sv_clear(register SV *sv)
            if (SvTYPE(sv) != SVt_PVIO)
                --PL_sv_objcount;       /* XXX Might want something more general */
        }
-       if (SvREFCNT(sv)) {
-               if (PL_in_clean_objs)
-                   croak("DESTROY created new reference to dead object");
-               /* DESTROY gave object new lease on life */
-               return;
-       }
     }
     if (SvTYPE(sv) >= SVt_PVMG && SvMAGIC(sv))
        mg_free(sv);
index 084e0ab..d58a782 100755 (executable)
@@ -16,7 +16,7 @@ BEGIN {
 
 use strict;
 
-print "1..82\n";
+print "1..87\n";
 
 my $i = 1;
 
@@ -413,3 +413,13 @@ sub X::foo4 ($);
 *X::foo4 = sub ($) {'ok'};
 print "not " unless X->foo4 eq 'ok';
 print "ok ", $i++, "\n";
+
+# test if the (*) prototype allows barewords, constants, scalar expressions,
+# globs and globrefs (just as CORE::open() does), all under stricture
+sub star (*&) { &{$_[1]} }
+my $star = 'FOO';
+star FOO, sub { print "ok $i\n" if $_[0] eq 'FOO' }; $i++;
+star "FOO", sub { print "ok $i\n" if $_[0] eq 'FOO' }; $i++;
+star $star, sub { print "ok $i\n" if $_[0] eq 'FOO' }; $i++;
+star *FOO, sub { print "ok $i\n" if $_[0] eq \*FOO }; $i++;
+star \*FOO, sub { print "ok $i\n" if $_[0] eq \*FOO }; $i++;
index 9f62482..a0f0f40 100755 (executable)
@@ -18,8 +18,14 @@ while (<DATA>) {
                eval "$_;";
        } else {
                ++$test;
-               @args = split(/:/,$_,99);
-               $ans = pop(@args);
+              if (m|^(.*?):(/.+)$|) {
+                  $ans = $2;
+                   @args = split(/:/,$1,99);
+              }
+              else {
+                   @args = split(/:/,$_,99);
+                   $ans = pop(@args);
+              }
                $try = "\$x = new Math::BigFloat \"$args[0]\";";
                if ($f eq "fnorm"){
                    $try .= "\$x+0;";
@@ -439,10 +445,10 @@ $Math::BigFloat::div_scale = 20
 $Math::BigFloat::div_scale = 40
 &fsqrt
 +0:0
--1:/^(0|NaN)$
--2:/^(0|NaN)$
--16:/^(0|NaN)$
--123.456:/^(0|NaN)$
+-1:/^(?i:0|NaNQ?)$
+-2:/^(?i:0|NaNQ?)$
+-16:/^(?i:0|NaNQ?)$
+-123.456:/^(?i:0|NaNQ?)$
 +1:1.
 +1.44:1.2
 +2:1.41421356237309504880168872420969807857
diff --git a/t/lib/fatal.t b/t/lib/fatal.t
new file mode 100755 (executable)
index 0000000..fb3757f
--- /dev/null
@@ -0,0 +1,27 @@
+#!./perl -w
+
+BEGIN {
+   chdir 't' if -d 't';
+   unshift @INC, '../lib';
+   print "1..9\n";
+}
+
+use strict;
+use Fatal qw(open);
+
+my $i = 1;
+eval { open FOO, '<lkjqweriuapofukndajsdlfjnvcvn' };
+print "not " unless $@ =~ /^Can't open/;
+print "ok $i\n"; ++$i;
+
+my $foo = 'FOO';
+for ('$foo', "'$foo'", "*$foo", "\\*$foo") {
+    eval qq{ open $_, '<$0' };
+    print "not " if $@;
+    print "ok $i\n"; ++$i;
+
+    print "not " unless scalar(<FOO>) =~ m|^#!./perl|;
+    print "not " if $@;
+    print "ok $i\n"; ++$i;
+    close FOO;
+}
index b1189a0..79be190 100755 (executable)
@@ -124,7 +124,7 @@ if($pid = fork()) {
     }
 
     # some machines seem to suffer from a race condition here
-#    sleep(1);
+    sleep(1);
 
     $sock = IO::Socket::INET->new("127.0.0.1:$port");
     if ($sock) {
old mode 100644 (file)
new mode 100755 (executable)
index e45f8ea..cf16a46 100755 (executable)
@@ -196,8 +196,8 @@ getpgrp                             # getpgrp
 getpriority $$, $$             # getpriority
 '???'                          # setpriority
 time                           # time
-localtime                      # localtime
-gmtime                         # gmtime
+localtime $^T                  # localtime
+gmtime $^T                     # gmtime
 sleep 1                                # sleep
 '???'                          # alarm
 '???'                          # shmget
index acef29d..48e22f6 100755 (executable)
@@ -476,3 +476,24 @@ for (2..3) {
 print $x->foo;
 EXPECT
 new1new22DESTROY2new33DESTROY31DESTROY1
+########
+re();
+sub re {
+    my $re = join '', eval 'qr/(?p{ $obj->method })/';
+    $re;
+}
+EXPECT
+########
+use strict;
+my $foo = "ZZZ\n";
+END { print $foo }
+EXPECT
+ZZZ
+########
+eval '
+use strict;
+my $foo = "ZZZ\n";
+END { print $foo }
+';
+EXPECT
+ZZZ
index b2c0e05..b6a3a3a 100755 (executable)
@@ -4,7 +4,7 @@
 # the format supported by op/regexp.t.  If you want to add a test
 # that does fit that format, add it to op/re_tests, not here.
 
-print "1..185\n";
+print "1..186\n";
 
 BEGIN {
     chdir 't' if -d 't';
@@ -825,6 +825,10 @@ print "not " unless($1 eq 'de');
 print "ok $test\n";
 $test++;
 
+print "not " unless $foo =~ /\Gef/g;
+print "ok $test\n";
+$test++;
+
 undef pos $foo;
 
 $foo=~/\G(..)/g;
old mode 100644 (file)
new mode 100755 (executable)
index f1d4045..3650512 100644 (file)
@@ -479,6 +479,7 @@ sub AUTOLOAD {
                croak "Your vendor has not defined $module macro \$constname";
        }
     }
+    no strict 'refs';
     *\$AUTOLOAD = sub () { \$val };
     goto &\$AUTOLOAD;
 }
index f549cb1..6d175f1 100644 (file)
@@ -447,7 +447,6 @@ if ($opt_q) {
    local @ARGV = @found;       # I'm lazy, sue me.
    my $found = 0;
    my %found_in;
-   my @pod;
 
    while (<>) {
       if (/^=head2\s+.*(?:$opt_q)/oi) {
index d2782f1..17023a0 100644 (file)
@@ -1805,7 +1805,7 @@ case 57:
 { STRLEN n_a; char *name = SvPV(((SVOP*)yyvsp[0].opval)->op_sv,n_a);
                          if (strEQ(name, "BEGIN") || strEQ(name, "END")
                              || strEQ(name, "INIT"))
-                             CvUNIQUE_on(PL_compcv);
+                             CvSPECIAL_on(PL_compcv);
                          yyval.opval = yyvsp[0].opval; }
 break;
 case 58:
@@ -1830,7 +1830,7 @@ case 63:
 break;
 case 64:
 #line 330 "perly.y"
-{ CvUNIQUE_on(PL_compcv); /* It's a BEGIN {} */ }
+{ CvSPECIAL_on(PL_compcv); /* It's a BEGIN {} */ }
 break;
 case 65:
 #line 332 "perly.y"
index 408215c..4ed8267 100644 (file)
@@ -471,7 +471,6 @@ do_aspawn(void *vreally, void **vmark, void **vsp)
     int status;
     int flag = P_WAIT;
     int index = 0;
-    STRLEN n_a;
 
     if (sp <= mark)
        return -1;
@@ -485,7 +484,7 @@ do_aspawn(void *vreally, void **vmark, void **vsp)
     }
 
     while (++mark <= sp) {
-       if (*mark && (str = SvPV(*mark, n_a)))
+       if (*mark && (str = SvPV_nolen(*mark)))
            argv[index++] = str;
        else
            argv[index++] = "";
@@ -493,7 +492,7 @@ do_aspawn(void *vreally, void **vmark, void **vsp)
     argv[index++] = 0;
    
     status = win32_spawnvp(flag,
-                          (const char*)(really ? SvPV(really,n_a) : argv[0]),
+                          (const char*)(really ? SvPV_nolen(really) : argv[0]),
                           (const char* const*)argv);
 
     if (status < 0 && (errno == ENOEXEC || errno == ENOENT)) {
@@ -506,7 +505,7 @@ do_aspawn(void *vreally, void **vmark, void **vsp)
            argv[sh_items] = w32_perlshell_vec[sh_items];
    
        status = win32_spawnvp(flag,
-                              (const char*)(really ? SvPV(really,n_a) : argv[0]),
+                              (const char*)(really ? SvPV_nolen(really) : argv[0]),
                               (const char* const*)argv);
     }
 
@@ -2235,21 +2234,22 @@ XS(w32_GetCwd)
      *   then it worked, set PV valid, 
      *   else leave it 'undef' 
      */
-    if (SvCUR(sv))
+    if (SvCUR(sv)) {
        SvPOK_on(sv);
-    EXTEND(SP,1);
-    ST(0) = sv;
-    XSRETURN(1);
+       EXTEND(SP,1);
+       ST(0) = sv;
+       XSRETURN(1);
+    }
+    XSRETURN_EMPTY;
 }
 
 static
 XS(w32_SetCwd)
 {
     dXSARGS;
-    STRLEN n_a;
     if (items != 1)
        croak("usage: Win32::SetCurrentDirectory($cwd)");
-    if (SetCurrentDirectory(SvPV(ST(0),n_a)))
+    if (SetCurrentDirectory(SvPV_nolen(ST(0))))
        XSRETURN_YES;
 
     XSRETURN_NO;
@@ -2265,16 +2265,18 @@ XS(w32_GetNextAvailDrive)
        root[0] = ix++;
        if (GetDriveType(root) == 1) {
            root[2] = '\0';
+           EXTEND(SP,1);
            XSRETURN_PV(root);
        }
     }
-    XSRETURN_UNDEF;
+    XSRETURN_EMPTY;
 }
 
 static
 XS(w32_GetLastError)
 {
     dXSARGS;
+    EXTEND(SP,1);
     XSRETURN_IV(GetLastError());
 }
 
@@ -2285,7 +2287,7 @@ XS(w32_SetLastError)
     if (items != 1)
        croak("usage: Win32::SetLastError($error)");
     SetLastError(SvIV(ST(0)));
-    XSRETURN_UNDEF;
+    XSRETURN_EMPTY;
 }
 
 static
@@ -2295,11 +2297,12 @@ XS(w32_LoginName)
     char *name = getlogin_buffer;
     DWORD size = sizeof(getlogin_buffer);
     if (GetUserName(name,&size)) {
+       EXTEND(SP,1);
        /* size includes NULL */
        ST(0) = sv_2mortal(newSVpv(name,size-1));
        XSRETURN(1);
     }
-    XSRETURN_UNDEF;
+    XSRETURN_EMPTY;
 }
 
 static
@@ -2309,11 +2312,12 @@ XS(w32_NodeName)
     char name[MAX_COMPUTERNAME_LENGTH+1];
     DWORD size = sizeof(name);
     if (GetComputerName(name,&size)) {
+       EXTEND(SP,1);
        /* size does NOT include NULL :-( */
        ST(0) = sv_2mortal(newSVpv(name,size));
        XSRETURN(1);
     }
-    XSRETURN_UNDEF;
+    XSRETURN_EMPTY;
 }
 
 
@@ -2333,6 +2337,7 @@ XS(w32_DomainName)
        SID_NAME_USE snu;
        if (LookupAccountName(NULL, name, (PSID)&sid, &sidlen,
                              dname, &dnamelen, &snu)) {
+           EXTEND(SP,1);
            XSRETURN_PV(dname);         /* all that for this */
        }
     }
@@ -2353,10 +2358,11 @@ XS(w32_DomainName)
                                -1, (LPSTR)dname, dnamelen, NULL, NULL);
        }
        NetApiBufferFree(pwi);
+       EXTEND(SP,1);
        XSRETURN_PV(dname);
     }
 #endif
-    XSRETURN_UNDEF;
+    XSRETURN_EMPTY;
 }
 
 static
@@ -2367,16 +2373,17 @@ XS(w32_FsType)
     DWORD flags, filecomplen;
     if (GetVolumeInformation(NULL, NULL, 0, NULL, &filecomplen,
                         &flags, fsname, sizeof(fsname))) {
-       if (GIMME == G_ARRAY) {
+       if (GIMME_V == G_ARRAY) {
            XPUSHs(sv_2mortal(newSVpv(fsname,0)));
            XPUSHs(sv_2mortal(newSViv(flags)));
            XPUSHs(sv_2mortal(newSViv(filecomplen)));
            PUTBACK;
            return;
        }
+       EXTEND(SP,1);
        XSRETURN_PV(fsname);
     }
-    XSRETURN_UNDEF;
+    XSRETURN_EMPTY;
 }
 
 static
@@ -2395,13 +2402,14 @@ XS(w32_GetOSVersion)
        PUTBACK;
        return;
     }
-    XSRETURN_UNDEF;
+    XSRETURN_EMPTY;
 }
 
 static
 XS(w32_IsWinNT)
 {
     dXSARGS;
+    EXTEND(SP,1);
     XSRETURN_IV(IsWinNT());
 }
 
@@ -2409,6 +2417,7 @@ static
 XS(w32_IsWin95)
 {
     dXSARGS;
+    EXTEND(SP,1);
     XSRETURN_IV(IsWin95());
 }
 
@@ -2427,7 +2436,7 @@ XS(w32_FormatMessage)
                      msgbuf, sizeof(msgbuf)-1, NULL))
        XSRETURN_PV(msgbuf);
 
-    XSRETURN_UNDEF;
+    XSRETURN_EMPTY;
 }
 
 static
@@ -2438,13 +2447,12 @@ XS(w32_Spawn)
     PROCESS_INFORMATION stProcInfo;
     STARTUPINFO stStartInfo;
     BOOL bSuccess = FALSE;
-    STRLEN n_a;
 
     if (items != 3)
        croak("usage: Win32::Spawn($cmdName, $args, $PID)");
 
-    cmd = SvPV(ST(0),n_a);
-    args = SvPV(ST(1), n_a);
+    cmd = SvPV_nolen(ST(0));
+    args = SvPV_nolen(ST(1));
 
     memset(&stStartInfo, 0, sizeof(stStartInfo));   /* Clear the block */
     stStartInfo.cb = sizeof(stStartInfo);          /* Set the structure size */
@@ -2474,6 +2482,7 @@ static
 XS(w32_GetTickCount)
 {
     dXSARGS;
+    EXTEND(SP,1);
     XSRETURN_IV(GetTickCount());
 }
 
@@ -2498,10 +2507,9 @@ XS(w32_GetShortPathName)
     if (len) {
        SvCUR_set(shortpath,len);
        ST(0) = shortpath;
+       XSRETURN(1);
     }
-    else
-       ST(0) = &PL_sv_undef;
-    XSRETURN(1);
+    XSRETURN_EMPTY;
 }
 
 static
@@ -2528,16 +2536,15 @@ XS(w32_GetFullPathName)
     if (len) {
        if (GIMME_V == G_ARRAY) {
            EXTEND(SP,1);
-           ST(1) = sv_2mortal(newSVpv(filepart,0));
+           XST_mPV(1,filepart);
            len = filepart - SvPVX(fullpath);
            items = 2;
        }
        SvCUR_set(fullpath,len);
        ST(0) = fullpath;
+       XSRETURN(items);
     }
-    else
-       ST(0) = &PL_sv_undef;
-    XSRETURN(items);
+    XSRETURN_EMPTY;
 }
 
 static