home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 October / usenetsourcesnewsgroupsinfomagicoctober1994disk2.iso / misc / volume20 / perl / patch07 < prev    next >
Encoding:
Text File  |  1991-06-19  |  52.4 KB  |  1,878 lines

  1. Newsgroups: comp.sources.misc
  2. From: Larry Wall <lwall@netlabs.com>
  3. Subject:  v20i059:  perl - The perl programming language, Patch07
  4. Message-ID: <1991Jun20.030604.8730@sparky.IMD.Sterling.COM>
  5. X-Md4-Signature: 4fa1de934e390fe5250280b21130be67
  6. Date: Thu, 20 Jun 1991 03:06:04 GMT
  7. Approved: kent@sparky.imd.sterling.com
  8.  
  9. Submitted-by: Larry Wall <lwall@netlabs.com>
  10. Posting-number: Volume 20, Issue 59
  11. Archive-name: perl/patch07
  12. Patch-To: perl: Volume 18, Issue 19-54
  13.  
  14. System: perl version 4.0
  15. Patch #: 7
  16. Priority: High
  17. Subject: patch #4, continued
  18.  
  19. Description:
  20.     See patch #4.
  21.  
  22. Fix:    From rn, say "| patch -p -N -d DIR", where DIR is your perl source
  23.     directory.  Outside of rn, say "cd DIR; patch -p -N <thisarticle".
  24.     If you don't have the patch program, apply the following by hand,
  25.     or get patch (version 2.0, latest patchlevel).
  26.  
  27.     After patching:
  28.         *** DO NOTHING--INSTALL ALL PATCHES UP THROUGH #09 FIRST ***
  29.  
  30.     If patch indicates that patchlevel is the wrong version, you may need
  31.     to apply one or more previous patches, or the patch may already
  32.     have been applied.  See the patchlevel.h file to find out what has or
  33.     has not been applied.  In any event, don't continue with the patch.
  34.  
  35.     If you are missing previous patches they can be obtained from me:
  36.  
  37.     Larry Wall
  38.     lwall@netlabs.com
  39.  
  40.     If you send a mail message of the following form it will greatly speed
  41.     processing:
  42.  
  43.     Subject: Command
  44.     @SH mailpatch PATH perl 4.0 LIST
  45.            ^ note the c
  46.  
  47.     where PATH is a return path FROM ME TO YOU either in Internet notation,
  48.     or in bang notation from some well-known host, and LIST is the number
  49.     of one or more patches you need, separated by spaces, commas, and/or
  50.     hyphens.  Saying 35- says everything from 35 to the end.
  51.  
  52.  
  53. Index: patchlevel.h
  54. Prereq: 6
  55. 1c1
  56. < #define PATCHLEVEL 6
  57. ---
  58. > #define PATCHLEVEL 7
  59.  
  60. Index: x2p/hash.c
  61. Prereq: 4.0
  62. *** x2p/hash.c.old    Fri Jun  7 12:28:04 1991
  63. --- x2p/hash.c    Fri Jun  7 12:28:05 1991
  64. ***************
  65. *** 1,11 ****
  66. ! /* $Header: hash.c,v 4.0 91/03/20 01:57:49 lwall Locked $
  67.    *
  68. !  *    Copyright (c) 1989, Larry Wall
  69.    *
  70. !  *    You may distribute under the terms of the GNU General Public License
  71. !  *    as specified in the README file that comes with the perl 3.0 kit.
  72.    *
  73.    * $Log:    hash.c,v $
  74.    * Revision 4.0  91/03/20  01:57:49  lwall
  75.    * 4.0 baseline.
  76.    * 
  77. --- 1,14 ----
  78. ! /* $RCSfile: hash.c,v $$Revision: 4.0.1.1 $$Date: 91/06/07 12:15:55 $
  79.    *
  80. !  *    Copyright (c) 1991, Larry Wall
  81.    *
  82. !  *    You may distribute under the terms of either the GNU General Public
  83. !  *    License or the Artistic License, as specified in the README file.
  84.    *
  85.    * $Log:    hash.c,v $
  86. +  * Revision 4.0.1.1  91/06/07  12:15:55  lwall
  87. +  * patch4: new copyright notice
  88. +  * 
  89.    * Revision 4.0  91/03/20  01:57:49  lwall
  90.    * 4.0 baseline.
  91.    * 
  92.  
  93. Index: hash.h
  94. Prereq: 4.0
  95. *** hash.h.old    Fri Jun  7 12:24:15 1991
  96. --- hash.h    Fri Jun  7 12:24:15 1991
  97. ***************
  98. *** 1,11 ****
  99. ! /* $Header: hash.h,v 4.0 91/03/20 01:22:38 lwall Locked $
  100.    *
  101. !  *    Copyright (c) 1989, Larry Wall
  102.    *
  103. !  *    You may distribute under the terms of the GNU General Public License
  104. !  *    as specified in the README file that comes with the perl 3.0 kit.
  105.    *
  106.    * $Log:    hash.h,v $
  107.    * Revision 4.0  91/03/20  01:22:38  lwall
  108.    * 4.0 baseline.
  109.    * 
  110. --- 1,14 ----
  111. ! /* $RCSfile: hash.h,v $$Revision: 4.0.1.1 $$Date: 91/06/07 11:10:33 $
  112.    *
  113. !  *    Copyright (c) 1991, Larry Wall
  114.    *
  115. !  *    You may distribute under the terms of either the GNU General Public
  116. !  *    License or the Artistic License, as specified in the README file.
  117.    *
  118.    * $Log:    hash.h,v $
  119. +  * Revision 4.0.1.1  91/06/07  11:10:33  lwall
  120. +  * patch4: new copyright notice
  121. +  * 
  122.    * Revision 4.0  91/03/20  01:22:38  lwall
  123.    * 4.0 baseline.
  124.    * 
  125.  
  126. Index: x2p/hash.h
  127. Prereq: 4.0
  128. *** x2p/hash.h.old    Fri Jun  7 12:28:07 1991
  129. --- x2p/hash.h    Fri Jun  7 12:28:07 1991
  130. ***************
  131. *** 1,11 ****
  132. ! /* $Header: hash.h,v 4.0 91/03/20 01:57:53 lwall Locked $
  133.    *
  134. !  *    Copyright (c) 1989, Larry Wall
  135.    *
  136. !  *    You may distribute under the terms of the GNU General Public License
  137. !  *    as specified in the README file that comes with the perl 3.0 kit.
  138.    *
  139.    * $Log:    hash.h,v $
  140.    * Revision 4.0  91/03/20  01:57:53  lwall
  141.    * 4.0 baseline.
  142.    * 
  143. --- 1,14 ----
  144. ! /* $RCSfile: hash.h,v $$Revision: 4.0.1.1 $$Date: 91/06/07 12:16:04 $
  145.    *
  146. !  *    Copyright (c) 1991, Larry Wall
  147.    *
  148. !  *    You may distribute under the terms of either the GNU General Public
  149. !  *    License or the Artistic License, as specified in the README file.
  150.    *
  151.    * $Log:    hash.h,v $
  152. +  * Revision 4.0.1.1  91/06/07  12:16:04  lwall
  153. +  * patch4: new copyright notice
  154. +  * 
  155.    * Revision 4.0  91/03/20  01:57:53  lwall
  156.    * 4.0 baseline.
  157.    * 
  158.  
  159. Index: hints/hpux.sh
  160. *** hints/hpux.sh.old    Fri Jun  7 12:24:28 1991
  161. --- hints/hpux.sh    Fri Jun  7 12:24:29 1991
  162. ***************
  163. *** 1,4 ****
  164. - d_syscall=$undef
  165.   echo " "
  166.   echo "NOTE: regression test op.read may fail due to an NFS bug in HP/UX."
  167.   echo "If so, don't worry about it."
  168. --- 1,7 ----
  169.   echo " "
  170.   echo "NOTE: regression test op.read may fail due to an NFS bug in HP/UX."
  171.   echo "If so, don't worry about it."
  172. + case `(uname -r) 2>/dev/null` in
  173. + *3.1*) d_syscall=$undef ;;
  174. + *2.1*) libswanted=`echo $libswanted | sed 's/ malloc / /'` ;;
  175. + esac
  176.  
  177. Index: installperl
  178. *** installperl.old    Fri Jun  7 12:25:08 1991
  179. --- installperl    Fri Jun  7 12:25:08 1991
  180. ***************
  181. *** 6,13 ****
  182.       shift;
  183.   }
  184.   
  185. ! @scripts = 'h2ph';
  186. ! @manpages = ('perl.man', 'h2ph.man');
  187.   
  188.   $version = sprintf("%5.3f", $]);
  189.   $release = substr($version,0,3);
  190. --- 6,13 ----
  191.       shift;
  192.   }
  193.   
  194. ! @scripts = ('h2ph', 'x2p/s2p', 'x2p/find2perl');
  195. ! @manpages = ('perl.man', 'h2ph.man', 'x2p/a2p.man', 'x2p/s2p.man');
  196.   
  197.   $version = sprintf("%5.3f", $]);
  198.   $release = substr($version,0,3);
  199. ***************
  200. *** 72,77 ****
  201. --- 72,85 ----
  202.       &link("$installbin/sperl$ver", "$installbin/suidperl") if $d_dosuid;
  203.   }
  204.   
  205. + ($bdev,$bino) = stat($installbin);
  206. + ($ddev,$dino) = stat('x2p');
  207. + if ($bdev != $ddev || $bino != $dino) {
  208. +     &unlink("$installbin/a2p");
  209. +     &cmd("cp x2p/a2p $installbin/a2p");
  210. + }
  211.   # Make some enemies in the name of standardization.   :-)
  212.   
  213.   ($udev,$uino) = stat("/usr/bin");
  214. ***************
  215. *** 85,95 ****
  216.   
  217.   # Install scripts.
  218.   
  219. ! &makedir($scriptdir);
  220.   
  221.   for (@scripts) {
  222. !     &cmd("cp $_ $scriptdir");
  223. !     &chmod(0755, "$scriptdir/$_");
  224.   }
  225.   
  226.   # Install library files.
  227. --- 93,103 ----
  228.   
  229.   # Install scripts.
  230.   
  231. ! &makedir($installscr);
  232.   
  233.   for (@scripts) {
  234. !     &cmd("cp $_ $installscr");
  235. !     s#.*/##; &chmod(0755, "$installscr/$_");
  236.   }
  237.   
  238.   # Install library files.
  239. ***************
  240. *** 111,116 ****
  241. --- 119,125 ----
  242.       if ($mdev != $ddev || $mino != $dino) {
  243.       for (@manpages) {
  244.           ($new = $_) =~ s/man$/$manext/;
  245. +         $new =~ s#.*/##;
  246.           print STDERR "  Installing $mansrc/$new\n";
  247.           next if $nonono;
  248.           open(MI,$_);
  249.  
  250. Index: makedepend.SH
  251. Prereq: 4.0
  252. *** makedepend.SH.old    Fri Jun  7 12:25:25 1991
  253. --- makedepend.SH    Fri Jun  7 12:25:26 1991
  254. ***************
  255. *** 15,23 ****
  256.   echo "Extracting makedepend (with variable substitutions)"
  257.   $spitshell >makedepend <<!GROK!THIS!
  258.   $startsh
  259. ! # $Header: makedepend.SH,v 4.0 91/03/20 01:27:04 lwall Locked $
  260.   #
  261.   # $Log:    makedepend.SH,v $
  262.   # Revision 4.0  91/03/20  01:27:04  lwall
  263.   # 4.0 baseline.
  264.   # 
  265. --- 15,29 ----
  266.   echo "Extracting makedepend (with variable substitutions)"
  267.   $spitshell >makedepend <<!GROK!THIS!
  268.   $startsh
  269. ! # $RCSfile: makedepend.SH,v $$Revision: 4.0.1.2 $$Date: 91/06/07 15:40:06 $
  270.   #
  271.   # $Log:    makedepend.SH,v $
  272. + # Revision 4.0.1.2  91/06/07  15:40:06  lwall
  273. + # patch4: fixed cppstdin to run in the right directory
  274. + # 
  275. + # Revision 4.0.1.1  91/06/07  11:20:06  lwall
  276. + # patch4: Makefile is no longer self-modifying code under makedepend
  277. + # 
  278.   # Revision 4.0  91/03/20  01:27:04  lwall
  279.   # 4.0 baseline.
  280.   # 
  281. ***************
  282. *** 28,34 ****
  283.   cat='$cat'
  284.   cppflags='$cppflags'
  285.   cp='$cp'
  286. ! cpp='$cppstdin'
  287.   echo='$echo'
  288.   egrep='$egrep'
  289.   expr='$expr'
  290. --- 34,41 ----
  291.   cat='$cat'
  292.   cppflags='$cppflags'
  293.   cp='$cp'
  294. ! cppstdin='$cppstdin'
  295. ! cppminus='$cppminus'
  296.   echo='$echo'
  297.   egrep='$egrep'
  298.   expr='$expr'
  299. ***************
  300. *** 46,55 ****
  301.   $cat /dev/null >.deptmp
  302.   $rm -f *.c.c c/*.c.c
  303.   if test -f Makefile; then
  304. !     mf=Makefile
  305. ! else
  306. !     mf=makefile
  307.   fi
  308.   if test -f $mf; then
  309.       defrule=`<$mf sed -n        \
  310.       -e '/^\.c\.o:.*;/{'        \
  311. --- 53,61 ----
  312.   $cat /dev/null >.deptmp
  313.   $rm -f *.c.c c/*.c.c
  314.   if test -f Makefile; then
  315. !     cp Makefile makefile
  316.   fi
  317. + mf=makefile
  318.   if test -f $mf; then
  319.       defrule=`<$mf sed -n        \
  320.       -e '/^\.c\.o:.*;/{'        \
  321. ***************
  322. *** 84,90 ****
  323.       -e 's|\\$||' \
  324.       -e p \
  325.       -e '}'
  326. !     $cpp -I/usr/local/include -I. $cppflags $file.c | \
  327.       $sed \
  328.       -e '/^# *[0-9]/!d' \
  329.       -e 's/^.*"\(.*\)".*$/'$filebase'.o: \1/' \
  330. --- 90,96 ----
  331.       -e 's|\\$||' \
  332.       -e p \
  333.       -e '}'
  334. !     $cppstdin -I/usr/local/include -I. $cppflags $cppminus <$file.c | sed -e 's#\.[0-9][0-9]*\.c#'"$file.c#" | \
  335.       $sed \
  336.       -e '/^# *[0-9]/!d' \
  337.       -e 's/^.*"\(.*\)".*$/'$filebase'.o: \1/' \
  338. ***************
  339. *** 93,144 ****
  340.       $uniq | $sort | $uniq >> .deptmp
  341.   done
  342.   
  343. ! $sed <Makefile >Makefile.new -e '1,/^# AUTOMATICALLY/!d'
  344.   
  345.   make shlist || ($echo "Searching for .SH files..."; \
  346.       $echo *.SH | $tr ' ' '\012' | $egrep -v '\*' >.shlist)
  347.   if $test -s .deptmp; then
  348.       for file in `cat .shlist`; do
  349. !     $echo `$expr X$file : 'X\(.*\).SH`: $file config.sh \; \
  350.           /bin/sh $file >> .deptmp
  351.       done
  352. !     $echo "Updating Makefile..."
  353.       $echo "# If this runs make out of memory, delete /usr/include lines." \
  354. !     >> Makefile.new
  355.       $sed 's|^\(.*\.o:\) *\(.*/.*\.c\) *$|\1 \2; '"$defrule \2|" .deptmp \
  356. !        >>Makefile.new
  357.   else
  358.       make hlist || ($echo "Searching for .h files..."; \
  359.       $echo *.h | $tr ' ' '\012' | $egrep -v '\*' >.hlist)
  360.       $echo "You don't seem to have a proper C preprocessor.  Using grep instead."
  361.       $egrep '^#include ' `cat .clist` `cat .hlist`  >.deptmp
  362. !     $echo "Updating Makefile..."
  363.       <.clist $sed -n                            \
  364.       -e '/\//{'                            \
  365.       -e   's|^\(.*\)/\(.*\)\.c|\2.o: \1/\2.c; '"$defrule \1/\2.c|p"    \
  366.       -e   d                                \
  367.       -e '}'                                \
  368. !     -e 's|^\(.*\)\.c|\1.o: \1.c|p' >> Makefile.new
  369.       <.hlist $sed -n 's|\(.*/\)\(.*\)|s= \2= \1\2=|p' >.hsed
  370.       <.deptmp $sed -n 's|c:#include "\(.*\)".*$|o: \1|p' | \
  371.          $sed 's|^[^;]*/||' | \
  372. !        $sed -f .hsed >> Makefile.new
  373.       <.deptmp $sed -n 's|c:#include <\(.*\)>.*$|o: /usr/include/\1|p' \
  374. !        >> Makefile.new
  375.       <.deptmp $sed -n 's|h:#include "\(.*\)".*$|h: \1|p' | \
  376. !        $sed -f .hsed >> Makefile.new
  377.       <.deptmp $sed -n 's|h:#include <\(.*\)>.*$|h: /usr/include/\1|p' \
  378. !        >> Makefile.new
  379.       for file in `$cat .shlist`; do
  380. !     $echo `$expr X$file : 'X\(.*\).SH`: $file config.sh \; \
  381. !         /bin/sh $file >> Makefile.new
  382.       done
  383.   fi
  384. ! $rm -f Makefile.old
  385. ! $cp Makefile Makefile.old
  386. ! $cp Makefile.new Makefile
  387. ! $rm Makefile.new
  388. ! $echo "# WARNING: Put nothing here or make depend will gobble it up!" >> Makefile
  389.   $rm -f .deptmp `sed 's/\.c/.c.c/' .clist` .shlist .clist .hlist .hsed
  390.   
  391.   !NO!SUBS!
  392. --- 99,150 ----
  393.       $uniq | $sort | $uniq >> .deptmp
  394.   done
  395.   
  396. ! $sed <$mf >$mf.new -e '1,/^# AUTOMATICALLY/!d'
  397.   
  398.   make shlist || ($echo "Searching for .SH files..."; \
  399.       $echo *.SH | $tr ' ' '\012' | $egrep -v '\*' >.shlist)
  400.   if $test -s .deptmp; then
  401.       for file in `cat .shlist`; do
  402. !     $echo `$expr X$file : 'X\(.*\).SH'`: $file config.sh \; \
  403.           /bin/sh $file >> .deptmp
  404.       done
  405. !     $echo "Updating $mf..."
  406.       $echo "# If this runs make out of memory, delete /usr/include lines." \
  407. !     >> $mf.new
  408.       $sed 's|^\(.*\.o:\) *\(.*/.*\.c\) *$|\1 \2; '"$defrule \2|" .deptmp \
  409. !        >>$mf.new
  410.   else
  411.       make hlist || ($echo "Searching for .h files..."; \
  412.       $echo *.h | $tr ' ' '\012' | $egrep -v '\*' >.hlist)
  413.       $echo "You don't seem to have a proper C preprocessor.  Using grep instead."
  414.       $egrep '^#include ' `cat .clist` `cat .hlist`  >.deptmp
  415. !     $echo "Updating $mf..."
  416.       <.clist $sed -n                            \
  417.       -e '/\//{'                            \
  418.       -e   's|^\(.*\)/\(.*\)\.c|\2.o: \1/\2.c; '"$defrule \1/\2.c|p"    \
  419.       -e   d                                \
  420.       -e '}'                                \
  421. !     -e 's|^\(.*\)\.c|\1.o: \1.c|p' >> $mf.new
  422.       <.hlist $sed -n 's|\(.*/\)\(.*\)|s= \2= \1\2=|p' >.hsed
  423.       <.deptmp $sed -n 's|c:#include "\(.*\)".*$|o: \1|p' | \
  424.          $sed 's|^[^;]*/||' | \
  425. !        $sed -f .hsed >> $mf.new
  426.       <.deptmp $sed -n 's|c:#include <\(.*\)>.*$|o: /usr/include/\1|p' \
  427. !        >> $mf.new
  428.       <.deptmp $sed -n 's|h:#include "\(.*\)".*$|h: \1|p' | \
  429. !        $sed -f .hsed >> $mf.new
  430.       <.deptmp $sed -n 's|h:#include <\(.*\)>.*$|h: /usr/include/\1|p' \
  431. !        >> $mf.new
  432.       for file in `$cat .shlist`; do
  433. !     $echo `$expr X$file : 'X\(.*\).SH'`: $file config.sh \; \
  434. !         /bin/sh $file >> $mf.new
  435.       done
  436.   fi
  437. ! $rm -f $mf.old
  438. ! $cp $mf $mf.old
  439. ! $cp $mf.new $mf
  440. ! $rm $mf.new
  441. ! $echo "# WARNING: Put nothing here or make depend will gobble it up!" >> $mf
  442.   $rm -f .deptmp `sed 's/\.c/.c.c/' .clist` .shlist .clist .hlist .hsed
  443.   
  444.   !NO!SUBS!
  445.  
  446. Index: malloc.c
  447. *** malloc.c.old    Fri Jun  7 12:25:29 1991
  448. --- malloc.c    Fri Jun  7 12:25:30 1991
  449. ***************
  450. *** 1,6 ****
  451. ! /* $RCSfile: malloc.c,v $$Revision: 4.0.1.1 $$Date: 91/04/11 17:48:31 $
  452.    *
  453.    * $Log:    malloc.c,v $
  454.    * Revision 4.0.1.1  91/04/11  17:48:31  lwall
  455.    * patch1: Configure now figures out malloc ptr type
  456.    * 
  457. --- 1,9 ----
  458. ! /* $RCSfile: malloc.c,v $$Revision: 4.0.1.2 $$Date: 91/06/07 11:20:45 $
  459.    *
  460.    * $Log:    malloc.c,v $
  461. +  * Revision 4.0.1.2  91/06/07  11:20:45  lwall
  462. +  * patch4: many, many itty-bitty portability fixes
  463. +  * 
  464.    * Revision 4.0.1.1  91/04/11  17:48:31  lwall
  465.    * patch1: Configure now figures out malloc ptr type
  466.    * 
  467. ***************
  468. *** 160,166 ****
  469.       p->ov_rmagic = RMAGIC;
  470.         *((u_int *)((caddr_t)p + nbytes - RSLOP)) = RMAGIC;
  471.   #endif
  472. !       return ((char *)(p + 1));
  473.   }
  474.   
  475.   /*
  476. --- 163,169 ----
  477.       p->ov_rmagic = RMAGIC;
  478.         *((u_int *)((caddr_t)p + nbytes - RSLOP)) = RMAGIC;
  479.   #endif
  480. !       return ((MALLOCPTRTYPE *)(p + 1));
  481.   }
  482.   
  483.   /*
  484. ***************
  485. *** 230,240 ****
  486.   }
  487.   
  488.   void
  489. ! free(cp)
  490. !     char *cp;
  491.   {   
  492.         register int size;
  493.       register union overhead *op;
  494.   
  495.         if (cp == NULL)
  496.             return;
  497. --- 233,244 ----
  498.   }
  499.   
  500.   void
  501. ! free(mp)
  502. !     MALLOCPTRTYPE *mp;
  503.   {   
  504.         register int size;
  505.       register union overhead *op;
  506. +     char *cp = (char*)mp;
  507.   
  508.         if (cp == NULL)
  509.             return;
  510. ***************
  511. *** 277,284 ****
  512.   int reall_srchlen = 4;    /* 4 should be plenty, -1 =>'s whole list */
  513.   
  514.   MALLOCPTRTYPE *
  515. ! realloc(cp, nbytes)
  516. !     char *cp; 
  517.       unsigned nbytes;
  518.   {   
  519.         register u_int onb;
  520. --- 281,288 ----
  521.   int reall_srchlen = 4;    /* 4 should be plenty, -1 =>'s whole list */
  522.   
  523.   MALLOCPTRTYPE *
  524. ! realloc(mp, nbytes)
  525. !     MALLOCPTRTYPE *mp; 
  526.       unsigned nbytes;
  527.   {   
  528.         register u_int onb;
  529. ***************
  530. *** 286,291 ****
  531. --- 290,296 ----
  532.         char *res;
  533.       register int i;
  534.       int was_alloced = 0;
  535. +     char *cp = (char*)mp;
  536.   
  537.         if (cp == NULL)
  538.             return (malloc(nbytes));
  539. ***************
  540. *** 331,345 ****
  541.               *((u_int *)((caddr_t)op + nbytes - RSLOP)) = RMAGIC;
  542.           }
  543.   #endif
  544. !         return(cp);
  545.       }
  546. !       if ((res = malloc(nbytes)) == NULL)
  547.             return (NULL);
  548.         if (cp != res)            /* common optimization */
  549.           (void)bcopy(cp, res, (int)((nbytes < onb) ? nbytes : onb));
  550.         if (was_alloced)
  551.           free(cp);
  552. !       return (res);
  553.   }
  554.   
  555.   /*
  556. --- 336,350 ----
  557.               *((u_int *)((caddr_t)op + nbytes - RSLOP)) = RMAGIC;
  558.           }
  559.   #endif
  560. !         return((MALLOCPTRTYPE*)cp);
  561.       }
  562. !       if ((res = (char*)malloc(nbytes)) == NULL)
  563.             return (NULL);
  564.         if (cp != res)            /* common optimization */
  565.           (void)bcopy(cp, res, (int)((nbytes < onb) ? nbytes : onb));
  566.         if (was_alloced)
  567.           free(cp);
  568. !       return ((MALLOCPTRTYPE*)res);
  569.   }
  570.   
  571.   /*
  572.  
  573. Index: hints/mips.sh
  574. *** hints/mips.sh.old    Fri Jun  7 12:24:31 1991
  575. --- hints/mips.sh    Fri Jun  7 12:24:31 1991
  576. ***************
  577. *** 1,6 ****
  578. ! optimize='-g'
  579.   d_volatile=undef
  580.   d_castneg=undef
  581.   cc=cc
  582.   libpth="/usr/lib/cmplrs/cc $libpth"
  583.   groupstype=int
  584. --- 1,17 ----
  585. ! cmd_cflags='optimize="-g"'
  586. ! perl_cflags='optimize="-g"'
  587. ! tcmd_cflags='optimize="-g"'
  588. ! tperl_cflags='optimize="-g"'
  589.   d_volatile=undef
  590.   d_castneg=undef
  591.   cc=cc
  592.   libpth="/usr/lib/cmplrs/cc $libpth"
  593.   groupstype=int
  594. + nm_opts='-B'
  595. + case $PATH in
  596. + *bsd*:/bin:*) cat <<END
  597. + NOTE:  Some people have reported having much better luck with Mips CC than
  598. + with the BSD cc.  Put /bin first in your PATH if you have difficulties.
  599. + END
  600. + ;;
  601. + esac
  602.  
  603. Index: h2pl/mkvars
  604. *** h2pl/mkvars.old    Fri Jun  7 12:24:06 1991
  605. --- h2pl/mkvars    Fri Jun  7 12:24:06 1991
  606. ***************
  607. *** 19,25 ****
  608.           $val = eval "&$var;";
  609.           if ($@) {
  610.           warn "$@: $_";
  611. !         print <<EOT
  612.   warn "\$$var isn't correctly set" if defined \$_main{'$var'};
  613.   EOT
  614.           next;
  615. --- 19,25 ----
  616.           $val = eval "&$var;";
  617.           if ($@) {
  618.           warn "$@: $_";
  619. !         print <<EOT;
  620.   warn "\$$var isn't correctly set" if defined \$_main{'$var'};
  621.   EOT
  622.           next;
  623.  
  624. Index: msdos/msdos.c
  625. Prereq: 4.0
  626. *** msdos/msdos.c.old    Fri Jun  7 12:25:45 1991
  627. --- msdos/msdos.c    Fri Jun  7 12:25:45 1991
  628. ***************
  629. *** 1,11 ****
  630. ! /* $Header: msdos.c,v 4.0 91/03/20 01:34:46 lwall Locked $
  631.    *
  632.    *    (C) Copyright 1989, 1990 Diomidis Spinellis.
  633.    *
  634. !  *    You may distribute under the terms of the GNU General Public License
  635. !  *    as specified in the README file that comes with the perl 3.0 kit.
  636.    *
  637.    * $Log:    msdos.c,v $
  638.    * Revision 4.0  91/03/20  01:34:46  lwall
  639.    * 4.0 baseline.
  640.    * 
  641. --- 1,14 ----
  642. ! /* $RCSfile: msdos.c,v $$Revision: 4.0.1.1 $$Date: 91/06/07 11:22:37 $
  643.    *
  644.    *    (C) Copyright 1989, 1990 Diomidis Spinellis.
  645.    *
  646. !  *    You may distribute under the terms of either the GNU General Public
  647. !  *    License or the Artistic License, as specified in the README file.
  648.    *
  649.    * $Log:    msdos.c,v $
  650. +  * Revision 4.0.1.1  91/06/07  11:22:37  lwall
  651. +  * patch4: new copyright notice
  652. +  * 
  653.    * Revision 4.0  91/03/20  01:34:46  lwall
  654.    * 4.0 baseline.
  655.    * 
  656.  
  657. Index: lib/newgetopt.pl
  658. *** lib/newgetopt.pl.old    Fri Jun  7 12:25:16 1991
  659. --- lib/newgetopt.pl    Fri Jun  7 12:25:16 1991
  660. ***************
  661. *** 0 ****
  662. --- 1,204 ----
  663. + # newgetopt.pl -- new options parsing
  664. + # SCCS Status     : @(#)@ newgetopt.pl    1.7
  665. + # Author          : Johan Vromans
  666. + # Created On      : Tue Sep 11 15:00:12 1990
  667. + # Last Modified By: Johan Vromans
  668. + # Last Modified On: Sun Oct 14 14:35:36 1990
  669. + # Update Count    : 34
  670. + # Status          : Okay
  671. + # This package implements a new getopt function. This function adheres
  672. + # to the new syntax (long option names, no bundling).
  673. + #
  674. + # Arguments to the function are:
  675. + #
  676. + #  - a list of possible options. These should designate valid perl
  677. + #    identifiers, optionally followed by an argument specifier ("="
  678. + #    for mandatory arguments or ":" for optional arguments) and an
  679. + #    argument type specifier: "n" or "i" for integer numbers, "f" for
  680. + #    real (fix) numbers or "s" for strings.
  681. + #
  682. + #  - if the first option of the list consists of non-alphanumeric
  683. + #    characters only, it is interpreted as a generic option starter.
  684. + #    Everything starting with one of the characters from the starter
  685. + #    will be considered an option.
  686. + #    Likewise, a double occurrence (e.g. "--") signals end of
  687. + #    the options list.
  688. + #    The default value for the starter is "-".
  689. + #
  690. + # Upon return, the option variables, prefixed with "opt_", are defined
  691. + # and set to the respective option arguments, if any.
  692. + # Options that do not take an argument are set to 1. Note that an
  693. + # option with an optional argument will be defined, but set to '' if
  694. + # no actual argument has been supplied.
  695. + # A return status of 0 (false) indicates that the function detected
  696. + # one or more errors.
  697. + #
  698. + # Special care is taken to give a correct treatment to optional arguments.
  699. + #
  700. + # E.g. if option "one:i" (i.e. takes an optional integer argument),
  701. + # then the following situations are handled:
  702. + #
  703. + #    -one -two        -> $opt_one = '', -two is next option
  704. + #    -one -2        -> $opt_one = -2
  705. + #
  706. + # Also, assume "foo=s" and "bar:s" :
  707. + #
  708. + #    -bar -xxx        -> $opt_bar = '', '-xxx' is next option
  709. + #    -foo -bar        -> $opt_foo = '-bar'
  710. + #    -foo --        -> $opt_foo = '--'
  711. + #
  712. + # HISTORY 
  713. + # 20-Sep-1990        Johan Vromans    
  714. + #    Set options w/o argument to 1.
  715. + #    Correct the dreadful semicolon/require bug.
  716. + package newgetopt;
  717. + $debug = 0;            # for debugging
  718. + sub main'NGetOpt {
  719. +     local (@optionlist) = @_;
  720. +     local ($[) = 0;
  721. +     local ($genprefix) = "-";
  722. +     local ($error) = 0;
  723. +     local ($opt, $optx, $arg, $type, $mand, @hits);
  724. +     # See if the first element of the optionlist contains option
  725. +     # starter characters.
  726. +     $genprefix = shift (@optionlist) if $optionlist[0] =~ /^\W+$/;
  727. +     # Turn into regexp.
  728. +     $genprefix =~ s/(\W)/\\\1/g;
  729. +     $genprefix = "[" . $genprefix . "]";
  730. +     # Verify correctness of optionlist.
  731. +     @hits = grep ($_ !~ /^\w+([=:][infse])?$/, @optionlist);
  732. +     if ( $#hits >= 0 ) {
  733. +     foreach $opt ( @hits ) {
  734. +         print STDERR ("Error in option spec: \"", $opt, "\"\n");
  735. +         $error++;
  736. +     }
  737. +     return 0;
  738. +     }
  739. +     # Process argument list
  740. +     while ( $#main'ARGV >= 0 ) {        #'){
  741. +     # >>> See also the continue block <<<
  742. +     # Get next argument
  743. +     $opt = shift (@main'ARGV);        #');
  744. +     print STDERR ("=> option \"", $opt, "\"\n") if $debug;
  745. +     $arg = undef;
  746. +     # Check for exhausted list.
  747. +     if ( $opt =~ /^$genprefix/o ) {
  748. +         # Double occurrence is terminator
  749. +         return ($error == 0) if $opt eq "$+$+";
  750. +         $opt = $';        # option name (w/o prefix)
  751. +     }
  752. +     else {
  753. +         # Apparently not an option - push back and exit.
  754. +         unshift (@main'ARGV, $opt);        #');
  755. +         return ($error == 0);
  756. +     }
  757. +     # Grep in option list. Hide regexp chars from option.
  758. +     ($optx = $opt) =~ s/(\W)/\\\1/g;
  759. +     @hits = grep (/^$optx([=:].+)?$/, @optionlist);
  760. +     if ( $#hits != 0 ) {
  761. +         print STDERR ("Unknown option: ", $opt, "\n");
  762. +         $error++;
  763. +         next;
  764. +     }
  765. +     # Determine argument status.
  766. +     undef $type;
  767. +     $type = $+ if $hits[0] =~ /[=:].+$/;
  768. +     print STDERR ("=> found \"$hits[0]\" for ", $opt, "\n") if $debug;
  769. +     # If it is an option w/o argument, we're almost finished with it.
  770. +     if ( ! defined $type ) {
  771. +         $arg = 1;        # supply explicit value
  772. +         next;
  773. +     }
  774. +     # Get mandatory status and type info.
  775. +     ($mand, $type) = $type =~ /^(.)(.)$/;
  776. +     # Check if the argument list is exhausted.
  777. +     if ( $#main'ARGV < 0 ) {        #'){
  778. +         # Complain if this option needs an argument.
  779. +         if ( $mand eq "=" ) {
  780. +         print STDERR ("Option ", $opt, " requires an argument\n");
  781. +         $error++;
  782. +         }
  783. +         next;
  784. +     }
  785. +     # Get (possibly optional) argument.
  786. +     $arg = shift (@main'ARGV);        #');
  787. +     # Check if it is a valid argument. A mandatory string takes
  788. +      # anything. 
  789. +     if ( "$mand$type" ne "=s" && $arg =~ /^$genprefix/o ) {
  790. +         # Check for option list terminator.
  791. +         if ( $arg eq "$+$+" ) {
  792. +         # Complain if an argument is required.
  793. +         if ($mand eq "=") {
  794. +             print STDERR ("Option ", $opt, " requires an argument\n");
  795. +             $error++;
  796. +         }
  797. +         # Push back so the outer loop will terminate.
  798. +         unshift (@main'ARGV, $arg);    #');
  799. +         $arg = "";    # don't assign it
  800. +         next;
  801. +         }
  802. +         # Maybe the optional argument is the next option?
  803. +         if ( $mand eq ":" && $' =~ /[a-zA-Z_]/ ) {
  804. +         # Yep. Push back.
  805. +         unshift (@main'ARGV, $arg);    #');
  806. +         $arg = "";    # don't assign it
  807. +         next;
  808. +         }
  809. +     }
  810. +     if ( $type eq "n" || $type eq "i" ) { # numeric/integer
  811. +         if ( $arg !~ /^-?[0-9]+$/ ) {
  812. +         print STDERR ("Value \"", $arg, "\" invalid for option ",
  813. +                    $opt, " (numeric required)\n");
  814. +         $error++;
  815. +         }
  816. +         next;
  817. +     }
  818. +     if ( $type eq "f" ) { # fixed real number, int is also ok
  819. +         if ( $arg !~ /^-?[0-9.]+$/ ) {
  820. +         print STDERR ("Value \"", $arg, "\" invalid for option ",
  821. +                    $opt, " (real number required)\n");
  822. +         $error++;
  823. +         }
  824. +         next;
  825. +     }
  826. +     if ( $type eq "s" ) { # string
  827. +         next;
  828. +     }
  829. +     }
  830. +     continue {
  831. +     print STDERR ("=> \$main'opt_$opt = $arg\n") if $debug;
  832. +     eval ("\$main'opt_$opt = \$arg");
  833. +     }
  834. +     return ($error == 0);
  835. + }
  836. + 1;
  837.  
  838. Index: hints/next.sh
  839. *** hints/next.sh.old    Fri Jun  7 12:24:33 1991
  840. --- hints/next.sh    Fri Jun  7 12:24:34 1991
  841. ***************
  842. *** 1,2 ****
  843.   : Just disable defaulting to -fpcc-struct-return, since gcc is native compiler.
  844. ! ccflags="$ccflags "
  845. --- 1,4 ----
  846.   : Just disable defaulting to -fpcc-struct-return, since gcc is native compiler.
  847. ! nativegcc='define'
  848. ! groupstype="int"
  849. ! usemymalloc="n"
  850.  
  851. Index: os2/os2.c
  852. Prereq: 4.0
  853. *** os2/os2.c.old    Fri Jun  7 12:25:51 1991
  854. --- os2/os2.c    Fri Jun  7 12:25:52 1991
  855. ***************
  856. *** 1,11 ****
  857. ! /* $Header: os2.c,v 4.0 91/03/20 01:36:21 lwall Locked $
  858.    *
  859.    *    (C) Copyright 1989, 1990 Diomidis Spinellis.
  860.    *
  861. !  *    You may distribute under the terms of the GNU General Public License
  862. !  *    as specified in the README file that comes with the perl 3.0 kit.
  863.    *
  864.    * $Log:    os2.c,v $
  865.    * Revision 4.0  91/03/20  01:36:21  lwall
  866.    * 4.0 baseline.
  867.    * 
  868. --- 1,14 ----
  869. ! /* $RCSfile: os2.c,v $$Revision: 4.0.1.1 $$Date: 91/06/07 11:23:06 $
  870.    *
  871.    *    (C) Copyright 1989, 1990 Diomidis Spinellis.
  872.    *
  873. !  *    You may distribute under the terms of either the GNU General Public
  874. !  *    License or the Artistic License, as specified in the README file.
  875.    *
  876.    * $Log:    os2.c,v $
  877. +  * Revision 4.0.1.1  91/06/07  11:23:06  lwall
  878. +  * patch4: new copyright notice
  879. +  * 
  880.    * Revision 4.0  91/03/20  01:36:21  lwall
  881.    * 4.0 baseline.
  882.    * 
  883.  
  884. Index: t/op/pat.t
  885. Prereq: 4.0
  886. *** t/op/pat.t.old    Fri Jun  7 12:27:08 1991
  887. --- t/op/pat.t    Fri Jun  7 12:27:09 1991
  888. ***************
  889. *** 1,8 ****
  890.   #!./perl
  891.   
  892. ! # $Header: pat.t,v 4.0 91/03/20 01:54:01 lwall Locked $
  893.   
  894. ! print "1..43\n";
  895.   
  896.   $x = "abc\ndef\n";
  897.   
  898. --- 1,8 ----
  899.   #!./perl
  900.   
  901. ! # $RCSfile: pat.t,v $$Revision: 4.0.1.1 $$Date: 91/06/07 12:01:26 $
  902.   
  903. ! print "1..48\n";
  904.   
  905.   $x = "abc\ndef\n";
  906.   
  907. ***************
  908. *** 118,120 ****
  909. --- 118,176 ----
  910.   print $1 eq 'yyy ' ? "ok 41\n" : "not ok 41\n";
  911.   print /x {3,4}/ ? "not ok 42\n" : "ok 42\n";
  912.   print /^xxx {3,4}/ ? "not ok 43\n" : "ok 43\n";
  913. + $_ = "now is the time for all good men to come to.";
  914. + @words = /(\w+)/g;
  915. + print join(':',@words) eq "now:is:the:time:for:all:good:men:to:come:to"
  916. +     ? "ok 44\n"
  917. +     : "not ok 44\n";
  918. + @words = ();
  919. + while (/\w+/g) {
  920. +     push(@words, $&);
  921. + }
  922. + print join(':',@words) eq "now:is:the:time:for:all:good:men:to:come:to"
  923. +     ? "ok 45\n"
  924. +     : "not ok 45\n";
  925. + @words = ();
  926. + while (/to/g) {
  927. +     push(@words, $&);
  928. + }
  929. + print join(':',@words) eq "to:to"
  930. +     ? "ok 46\n"
  931. +     : "not ok 46 @words\n";
  932. + @words = /to/g;
  933. + print join(':',@words) eq "to:to"
  934. +     ? "ok 47\n"
  935. +     : "not ok 47 @words\n";
  936. + $_ = "abcdefghi";
  937. + $pat1 = 'def';
  938. + $pat2 = '^def';
  939. + $pat3 = '.def.';
  940. + $pat4 = 'abc';
  941. + $pat5 = '^abc';
  942. + $pat6 = 'abc$';
  943. + $pat7 = 'ghi';
  944. + $pat8 = '\w*ghi';
  945. + $pat9 = 'ghi$';
  946. + $t1=$t2=$t3=$t4=$t5=$t6=$t7=$t8=$t9=0;
  947. + for $iter (1..5) {
  948. +     $t1++ if /$pat1/o;
  949. +     $t2++ if /$pat2/o;
  950. +     $t3++ if /$pat3/o;
  951. +     $t4++ if /$pat4/o;
  952. +     $t5++ if /$pat5/o;
  953. +     $t6++ if /$pat6/o;
  954. +     $t7++ if /$pat7/o;
  955. +     $t8++ if /$pat8/o;
  956. +     $t9++ if /$pat9/o;
  957. + }
  958. + $x = "$t1$t2$t3$t4$t5$t6$t7$t8$t9";
  959. + print $x eq '505550555' ? "ok 48\n" : "not ok 48 $x\n";
  960.  
  961. Index: emacs/perl-mode.el
  962. *** emacs/perl-mode.el.old    Fri Jun  7 12:23:45 1991
  963. --- emacs/perl-mode.el    Fri Jun  7 12:23:46 1991
  964. ***************
  965. *** 572,578 ****
  966.     (or arg (setq arg 1))
  967.     (if (< arg 0) (forward-char 1))
  968.     (and (/= arg 0)
  969. !        (re-search-backward "^\\s(\\|^\\s-*sub\\b[^{]+{\\|^\\s-*format\\b[^=]*="
  970.                  nil 'move arg)
  971.          (goto-char (1- (match-end 0))))
  972.     (point))
  973. --- 572,578 ----
  974.     (or arg (setq arg 1))
  975.     (if (< arg 0) (forward-char 1))
  976.     (and (/= arg 0)
  977. !        (re-search-backward "^\\s(\\|^\\s-*sub\\b[^{]+{\\|^\\s-*format\\b[^=]*=\\|^\\."
  978.                  nil 'move arg)
  979.          (goto-char (1- (match-end 0))))
  980.     (point))
  981.  
  982. Index: perl.c
  983. *** perl.c.old    Fri Jun  7 12:25:55 1991
  984. --- perl.c    Fri Jun  7 12:25:57 1991
  985. ***************
  986. *** 1,11 ****
  987. ! char rcsid[] = "$RCSfile: perl.c,v $$Revision: 4.0.1.1 $$Date: 91/04/11 17:49:05 $\nPatch level: ###\n";
  988.   /*
  989. !  *    Copyright (c) 1989, Larry Wall
  990.    *
  991. !  *    You may distribute under the terms of the GNU General Public License
  992. !  *    as specified in the README file that comes with the perl 3.0 kit.
  993.    *
  994.    * $Log:    perl.c,v $
  995.    * Revision 4.0.1.1  91/04/11  17:49:05  lwall
  996.    * patch1: fixed undefined environ problem
  997.    * 
  998. --- 1,20 ----
  999. ! char rcsid[] = "$RCSfile: perl.c,v $$Revision: 4.0.1.3 $$Date: 91/06/07 11:40:18 $\nPatch level: ###\n";
  1000.   /*
  1001. !  *    Copyright (c) 1991, Larry Wall
  1002.    *
  1003. !  *    You may distribute under the terms of either the GNU General Public
  1004. !  *    License or the Artistic License, as specified in the README file.
  1005.    *
  1006.    * $Log:    perl.c,v $
  1007. +  * Revision 4.0.1.3  91/06/07  11:40:18  lwall
  1008. +  * patch4: changed old $^P to $^X
  1009. +  * 
  1010. +  * Revision 4.0.1.2  91/06/07  11:26:16  lwall
  1011. +  * patch4: new copyright notice
  1012. +  * patch4: added $^P variable to control calling of perldb routines
  1013. +  * patch4: added $^F variable to specify maximum system fd, default 2
  1014. +  * patch4: debugger lost track of lines in eval
  1015. +  * 
  1016.    * Revision 4.0.1.1  91/04/11  17:49:05  lwall
  1017.    * patch1: fixed undefined environ problem
  1018.    * 
  1019. ***************
  1020. *** 23,28 ****
  1021. --- 32,39 ----
  1022.   #include "patchlevel.h"
  1023.   #endif
  1024.   
  1025. + char *getenv();
  1026.   #ifdef IAMSUID
  1027.   #ifndef DOSUID
  1028.   #define DOSUID
  1029. ***************
  1030. *** 50,56 ****
  1031.   {
  1032.       register STR *str;
  1033.       register char *s;
  1034. !     char *index(), *strcpy(), *getenv();
  1035.       bool dosearch = FALSE;
  1036.   #ifdef DOSUID
  1037.       char *validarg = "";
  1038. --- 61,67 ----
  1039.   {
  1040.       register STR *str;
  1041.       register char *s;
  1042. !     char *getenv();
  1043.       bool dosearch = FALSE;
  1044.   #ifdef DOSUID
  1045.       char *validarg = "";
  1046. ***************
  1047. *** 656,662 ****
  1048.       (void)hadd(sigstab);
  1049.       }
  1050.   
  1051. !     magicalize("!#?^~=-%.+&*()<>,\\/[|`':\004\t\024\027");
  1052.       userinit();        /* in case linked C routines want magical variables */
  1053.   
  1054.       amperstab = stabent("&",allstabs);
  1055. --- 667,673 ----
  1056.       (void)hadd(sigstab);
  1057.       }
  1058.   
  1059. !     magicalize("!#?^~=-%.+&*()<>,\\/[|`':\004\t\020\024\027\006");
  1060.       userinit();        /* in case linked C routines want magical variables */
  1061.   
  1062.       amperstab = stabent("&",allstabs);
  1063. ***************
  1064. *** 740,746 ****
  1065.       str_set(stab_val(tmpstab),origfilename);
  1066.       magicname("0", Nullch, 0);
  1067.       }
  1068. !     if (tmpstab = stabent("\020",allstabs))
  1069.       str_set(stab_val(tmpstab),origargv[0]);
  1070.       if (argvstab = stabent("ARGV",allstabs)) {
  1071.       argvstab->str_pok |= SP_MULTI;
  1072. --- 751,757 ----
  1073.       str_set(stab_val(tmpstab),origfilename);
  1074.       magicname("0", Nullch, 0);
  1075.       }
  1076. !     if (tmpstab = stabent("\030",allstabs))
  1077.       str_set(stab_val(tmpstab),origargv[0]);
  1078.       if (argvstab = stabent("ARGV",allstabs)) {
  1079.       argvstab->str_pok |= SP_MULTI;
  1080. ***************
  1081. *** 830,835 ****
  1082. --- 841,871 ----
  1083.       }
  1084.   }
  1085.   
  1086. + void
  1087. + savelines(array, str)
  1088. + ARRAY *array;
  1089. + STR *str;
  1090. + {
  1091. +     register char *s = str->str_ptr;
  1092. +     register char *send = str->str_ptr + str->str_cur;
  1093. +     register char *t;
  1094. +     register int line = 1;
  1095. +     while (s && s < send) {
  1096. +     STR *tmpstr = Str_new(85,0);
  1097. +     t = index(s, '\n');
  1098. +     if (t)
  1099. +         t++;
  1100. +     else
  1101. +         t = send;
  1102. +     str_nset(tmpstr, s, t - s);
  1103. +     astore(array, line++, tmpstr);
  1104. +     s = t;
  1105. +     }
  1106. + }
  1107.   /* this routine is in perl.c by virtue of being sort of an alternate main() */
  1108.   
  1109.   int
  1110. ***************
  1111. *** 871,877 ****
  1112.       curcmd->c_filestab = fstab("(eval)");
  1113.       curcmd->c_line = 1;
  1114.       str_sset(linestr,str);
  1115. !     str_cat(linestr,";");        /* be kind to them */
  1116.       }
  1117.       else {
  1118.       if (last_root && !in_eval) {
  1119. --- 907,915 ----
  1120.       curcmd->c_filestab = fstab("(eval)");
  1121.       curcmd->c_line = 1;
  1122.       str_sset(linestr,str);
  1123. !     str_cat(linestr,";\n");        /* be kind to them */
  1124. !     if (perldb)
  1125. !         savelines(stab_xarray(curcmd->c_filestab), linestr);
  1126.       }
  1127.       else {
  1128.       if (last_root && !in_eval) {
  1129. ***************
  1130. *** 1201,1206 ****
  1131. --- 1239,1247 ----
  1132.       fprintf(stderr, "unexec of %s into %s failed!\n", perlpath, dumpname);
  1133.       exit(status);
  1134.   #else
  1135. + #ifdef MSDOS
  1136. +     abort();    /* nothing else to do */
  1137. + #else /* ! MSDOS */
  1138.   #   ifndef SIGABRT
  1139.   #    define SIGABRT SIGILL
  1140.   #   endif
  1141. ***************
  1142. *** 1208,1213 ****
  1143. --- 1249,1255 ----
  1144.   #    define SIGILL 6        /* blech */
  1145.   #   endif
  1146.       kill(getpid(),SIGABRT);    /* for use with undump */
  1147. + #endif /* ! MSDOS */
  1148.   #endif
  1149.   }
  1150.   
  1151.  
  1152. Index: perl.h
  1153. *** perl.h.old    Fri Jun  7 12:26:00 1991
  1154. --- perl.h    Fri Jun  7 12:26:01 1991
  1155. ***************
  1156. *** 1,11 ****
  1157. ! /* $RCSfile: perl.h,v $$Revision: 4.0.1.1 $$Date: 91/04/11 17:49:51 $
  1158.    *
  1159. !  *    Copyright (c) 1989, Larry Wall
  1160.    *
  1161. !  *    You may distribute under the terms of the GNU General Public License
  1162. !  *    as specified in the README file that comes with the perl 3.0 kit.
  1163.    *
  1164.    * $Log:    perl.h,v $
  1165.    * Revision 4.0.1.1  91/04/11  17:49:51  lwall
  1166.    * patch1: hopefully straightened out some of the Xenix mess
  1167.    * 
  1168. --- 1,16 ----
  1169. ! /* $RCSfile: perl.h,v $$Revision: 4.0.1.2 $$Date: 91/06/07 11:28:33 $
  1170.    *
  1171. !  *    Copyright (c) 1991, Larry Wall
  1172.    *
  1173. !  *    You may distribute under the terms of either the GNU General Public
  1174. !  *    License or the Artistic License, as specified in the README file.
  1175.    *
  1176.    * $Log:    perl.h,v $
  1177. +  * Revision 4.0.1.2  91/06/07  11:28:33  lwall
  1178. +  * patch4: new copyright notice
  1179. +  * patch4: made some allowances for "semi-standard" C
  1180. +  * patch4: many, many itty-bitty portability fixes
  1181. +  * 
  1182.    * Revision 4.0.1.1  91/04/11  17:49:51  lwall
  1183.    * patch1: hopefully straightened out some of the Xenix mess
  1184.    * 
  1185. ***************
  1186. *** 47,53 ****
  1187.   
  1188.   #endif /* !MSDOS */
  1189.   
  1190. ! #if defined(HASVOLATILE) || defined(__STDC__)
  1191.   #define VOLATILE volatile
  1192.   #else
  1193.   #define VOLATILE
  1194. --- 52,62 ----
  1195.   
  1196.   #endif /* !MSDOS */
  1197.   
  1198. ! #if defined(__STDC__) || defined(_AIX) || defined(__stdc__)
  1199. ! # define STANDARD_C 1
  1200. ! #endif
  1201. ! #if defined(HASVOLATILE) || defined(STANDARD_C)
  1202.   #define VOLATILE volatile
  1203.   #else
  1204.   #define VOLATILE
  1205. ***************
  1206. *** 81,93 ****
  1207.   #include <ctype.h>
  1208.   #include <setjmp.h>
  1209.   #ifndef MSDOS
  1210. ! #include <sys/param.h>    /* if this needs types.h we're still wrong */
  1211.   #endif
  1212. ! #ifdef __STDC__
  1213.   /* Use all the "standard" definitions */
  1214.   #include <stdlib.h>
  1215.   #include <string.h>
  1216. ! #endif /* __STDC__ */
  1217.   
  1218.   #if defined(HAS_MEMCMP) && defined(mips) && BYTEORDER == 0x1234
  1219.   #undef HAS_MEMCMP
  1220. --- 90,105 ----
  1221.   #include <ctype.h>
  1222.   #include <setjmp.h>
  1223.   #ifndef MSDOS
  1224. ! #ifdef PARAM_NEEDS_TYPES
  1225. ! #include <sys/types.h>
  1226.   #endif
  1227. ! #include <sys/param.h>
  1228. ! #endif
  1229. ! #ifdef STANDARD_C
  1230.   /* Use all the "standard" definitions */
  1231.   #include <stdlib.h>
  1232.   #include <string.h>
  1233. ! #endif /* STANDARD_C */
  1234.   
  1235.   #if defined(HAS_MEMCMP) && defined(mips) && BYTEORDER == 0x1234
  1236.   #undef HAS_MEMCMP
  1237. ***************
  1238. *** 95,113 ****
  1239.   
  1240.   #ifdef HAS_MEMCPY
  1241.   
  1242. ! #  ifndef __STDC__
  1243.   #    ifndef memcpy
  1244.   extern char * memcpy(), *memset();
  1245.   extern int memcmp();
  1246.   #    endif /* ndef memcpy */
  1247. ! #  endif /* ndef __STDC__ */
  1248.   
  1249. ! #define bcopy(s1,s2,l) memcpy(s2,s1,l)
  1250. ! #define bzero(s,l) memset(s,0,l)
  1251.   #endif /* HAS_MEMCPY */
  1252.   
  1253.   #ifndef HAS_BCMP        /* prefer bcmp slightly 'cuz it doesn't order */
  1254. ! #define bcmp(s1,s2,l) memcmp(s1,s2,l)
  1255.   #endif
  1256.   
  1257.   #ifndef _TYPES_        /* If types.h defines this it's easy. */
  1258. --- 107,131 ----
  1259.   
  1260.   #ifdef HAS_MEMCPY
  1261.   
  1262. ! #  ifndef STANDARD_C
  1263.   #    ifndef memcpy
  1264.   extern char * memcpy(), *memset();
  1265.   extern int memcmp();
  1266.   #    endif /* ndef memcpy */
  1267. ! #  endif /* ndef STANDARD_C */
  1268.   
  1269. ! #   ifndef bcopy
  1270. ! #    define bcopy(s1,s2,l) memcpy(s2,s1,l)
  1271. ! #   endif
  1272. ! #   ifndef bzero
  1273. ! #    define bzero(s,l) memset(s,0,l)
  1274. ! #   endif
  1275.   #endif /* HAS_MEMCPY */
  1276.   
  1277.   #ifndef HAS_BCMP        /* prefer bcmp slightly 'cuz it doesn't order */
  1278. ! #   ifndef bcmp
  1279. ! #    define bcmp(s1,s2,l) memcmp(s1,s2,l)
  1280. ! #   endif
  1281.   #endif
  1282.   
  1283.   #ifndef _TYPES_        /* If types.h defines this it's easy. */
  1284. ***************
  1285. *** 245,250 ****
  1286. --- 263,275 ----
  1287.   #   endif
  1288.   #endif
  1289.   
  1290. + #ifdef FPUTS_BOTCH
  1291. + /* work around botch in SunOS 4.0.1 and 4.0.2 */
  1292. + #   ifndef fputs
  1293. + #    define fputs(str,fp) fprintf(fp,"%s",str)
  1294. + #   endif
  1295. + #endif
  1296.   /*
  1297.    * The following gobbledygook brought to you on behalf of __STDC__.
  1298.    * (I could just use #ifndef __STDC__, but this is more bulletproof
  1299. ***************
  1300. *** 345,350 ****
  1301. --- 370,379 ----
  1302.   #   define S_ISGID 02000
  1303.   #endif
  1304.   
  1305. + #ifdef f_next
  1306. + #undef f_next
  1307. + #endif
  1308.   typedef unsigned int STRLEN;
  1309.   
  1310.   typedef struct arg ARG;
  1311. ***************
  1312. *** 377,383 ****
  1313.   #   define I286
  1314.   #endif
  1315.   
  1316. ! #ifndef    __STDC__
  1317.   #ifdef CHARSPRINTF
  1318.       char *sprintf();
  1319.   #else
  1320. --- 406,412 ----
  1321.   #   define I286
  1322.   #endif
  1323.   
  1324. ! #ifndef    STANDARD_C
  1325.   #ifdef CHARSPRINTF
  1326.       char *sprintf();
  1327.   #else
  1328. ***************
  1329. *** 681,686 ****
  1330. --- 710,720 ----
  1331.   EXT bool sawvec INIT(FALSE);
  1332.   EXT bool localizing INIT(FALSE);    /* are we processing a local() list? */
  1333.   
  1334. + #ifndef MAXSYSFD
  1335. + #   define MAXSYSFD 2
  1336. + #endif
  1337. + EXT int maxsysfd INIT(MAXSYSFD);    /* top fd to pass to subprocesses */
  1338.   #ifdef CSH
  1339.   char *cshname INIT(CSH);
  1340.   int cshlen INIT(0);
  1341. ***************
  1342. *** 790,796 ****
  1343.   /* Fix these up for __STDC__ */
  1344.   EXT long basetime INIT(0);
  1345.   char *mktemp();
  1346. ! #ifndef __STDC__
  1347.   /* All of these are in stdlib.h or time.h for ANSI C */
  1348.   double atof();
  1349.   long time();
  1350. --- 824,830 ----
  1351.   /* Fix these up for __STDC__ */
  1352.   EXT long basetime INIT(0);
  1353.   char *mktemp();
  1354. ! #ifndef STANDARD_C
  1355.   /* All of these are in stdlib.h or time.h for ANSI C */
  1356.   double atof();
  1357.   long time();
  1358. ***************
  1359. *** 797,803 ****
  1360.   struct tm *gmtime(), *localtime();
  1361.   char *index(), *rindex();
  1362.   char *strcpy(), *strcat();
  1363. ! #endif /* ! __STDC__ */
  1364.   
  1365.   #ifdef EUNICE
  1366.   #define UNLINK unlnk
  1367. --- 831,837 ----
  1368.   struct tm *gmtime(), *localtime();
  1369.   char *index(), *rindex();
  1370.   char *strcpy(), *strcat();
  1371. ! #endif /* ! STANDARD_C */
  1372.   
  1373.   #ifdef EUNICE
  1374.   #define UNLINK unlnk
  1375.  
  1376. Index: perl.man
  1377. *** perl.man.old    Fri Jun  7 12:26:10 1991
  1378. --- perl.man    Fri Jun  7 12:26:13 1991
  1379. ***************
  1380. *** 1,7 ****
  1381.   .rn '' }`
  1382. ! ''' $RCSfile: perl.man,v $$Revision: 4.0.1.1 $$Date: 91/04/11 17:50:44 $
  1383.   ''' 
  1384.   ''' $Log:    perl.man,v $
  1385.   ''' Revision 4.0.1.1  91/04/11  17:50:44  lwall
  1386.   ''' patch1: fixed some typos
  1387.   ''' 
  1388. --- 1,14 ----
  1389.   .rn '' }`
  1390. ! ''' $RCSfile: perl.man,v $$Revision: 4.0.1.2 $$Date: 91/06/07 11:41:23 $
  1391.   ''' 
  1392.   ''' $Log:    perl.man,v $
  1393. + ''' Revision 4.0.1.2  91/06/07  11:41:23  lwall
  1394. + ''' patch4: added global modifier for pattern matches
  1395. + ''' patch4: default top-of-form format is now FILEHANDLE_TOP
  1396. + ''' patch4: added $^P variable to control calling of perldb routines
  1397. + ''' patch4: added $^F variable to specify maximum system fd, default 2
  1398. + ''' patch4: changed old $^P to $^X
  1399. + ''' 
  1400.   ''' Revision 4.0.1.1  91/04/11  17:50:44  lwall
  1401.   ''' patch1: fixed some typos
  1402.   ''' 
  1403. ***************
  1404. *** 1606,1663 ****
  1405.           (getpwuid($<))[7] || die "You're homeless!\en";
  1406.   
  1407.   .fi
  1408. - ''' Beginning of part 2
  1409. - ''' $RCSfile: perl.man,v $$Revision: 4.0.1.1 $$Date: 91/04/11 17:50:44 $
  1410. - '''
  1411. - ''' $Log:    perl.man,v $
  1412. - ''' Revision 4.0.1.1  91/04/11  17:50:44  lwall
  1413. - ''' patch1: fixed some typos
  1414. - ''' 
  1415. - ''' Revision 4.0  91/03/20  01:38:08  lwall
  1416. - ''' 4.0 baseline.
  1417. - ''' 
  1418. - ''' Revision 3.0.1.11  91/01/11  18:17:08  lwall
  1419. - ''' patch42: fixed some man page entries
  1420. - ''' 
  1421. - ''' Revision 3.0.1.10  90/11/10  01:46:29  lwall
  1422. - ''' patch38: random cleanup
  1423. - ''' patch38: added alarm function
  1424. - ''' 
  1425. - ''' Revision 3.0.1.9  90/10/15  18:17:37  lwall
  1426. - ''' patch29: added caller
  1427. - ''' patch29: index and substr now have optional 3rd args
  1428. - ''' patch29: added SysV IPC
  1429. - ''' 
  1430. - ''' Revision 3.0.1.8  90/08/13  22:21:00  lwall
  1431. - ''' patch28: documented that you can't interpolate $) or $| in pattern
  1432. - ''' 
  1433. - ''' Revision 3.0.1.7  90/08/09  04:27:04  lwall
  1434. - ''' patch19: added require operator
  1435. - ''' 
  1436. - ''' Revision 3.0.1.6  90/08/03  11:15:29  lwall
  1437. - ''' patch19: Intermediate diffs for Randal
  1438. - ''' 
  1439. - ''' Revision 3.0.1.5  90/03/27  16:15:17  lwall
  1440. - ''' patch16: MSDOS support
  1441. - ''' 
  1442. - ''' Revision 3.0.1.4  90/03/12  16:46:02  lwall
  1443. - ''' patch13: documented behavior of @array = /noparens/
  1444. - ''' 
  1445. - ''' Revision 3.0.1.3  90/02/28  17:55:58  lwall
  1446. - ''' patch9: grep now returns number of items matched in scalar context
  1447. - ''' patch9: documented in-place modification capabilites of grep
  1448. - ''' 
  1449. - ''' Revision 3.0.1.2  89/11/17  15:30:16  lwall
  1450. - ''' patch5: fixed some manual typos and indent problems
  1451. - ''' 
  1452. - ''' Revision 3.0.1.1  89/11/11  04:43:10  lwall
  1453. - ''' patch2: made some line breaks depend on troff vs. nroff
  1454. - ''' patch2: example of unshift had args backwards
  1455. - ''' 
  1456. - ''' Revision 3.0  89/10/18  15:21:37  lwall
  1457. - ''' 3.0 baseline
  1458. - ''' 
  1459. - '''
  1460.   .PP
  1461.   Along with the literals and variables mentioned earlier,
  1462.   the operations in the following section can serve as terms in an expression.
  1463. --- 1613,1618 ----
  1464. ***************
  1465. *** 1796,1802 ****
  1466.   
  1467.   .fi
  1468.   .ne 23
  1469. ! Here's an example of looking up non-numeric uids:
  1470.   .nf
  1471.   
  1472.       print "User: ";
  1473. --- 1751,1757 ----
  1474.   
  1475.   .fi
  1476.   .ne 23
  1477. ! Here's an example that looks up non-numeric uids in the passwd file:
  1478.   .nf
  1479.   
  1480.       print "User: ";
  1481. ***************
  1482. *** 2718,2725 ****
  1483.   Does the same thing as the stat() function, but stats a symbolic link
  1484.   instead of the file the symbolic link points to.
  1485.   If symbolic links are unimplemented on your system, a normal stat is done.
  1486. ! .Ip "m/PATTERN/io" 8 4
  1487. ! .Ip "/PATTERN/io" 8
  1488.   Searches a string for a pattern match, and returns true (1) or false (\'\').
  1489.   If no string is specified via the =~ or !~ operator,
  1490.   the $_ string is searched.
  1491. --- 2673,2680 ----
  1492.   Does the same thing as the stat() function, but stats a symbolic link
  1493.   instead of the file the symbolic link points to.
  1494.   If symbolic links are unimplemented on your system, a normal stat is done.
  1495. ! .Ip "m/PATTERN/gio" 8 4
  1496. ! .Ip "/PATTERN/gio" 8
  1497.   Searches a string for a pattern match, and returns true (1) or false (\'\').
  1498.   If no string is specified via the =~ or !~ operator,
  1499.   the $_ string is searched.
  1500. ***************
  1501. *** 2778,2783 ****
  1502. --- 2733,2768 ----
  1503.   of the line, and assigns those three fields to $F1, $F2 and $Etc.
  1504.   The conditional is true if any variables were assigned, i.e. if the pattern
  1505.   matched.
  1506. + .Sp
  1507. + The \*(L"g\*(R" modifier specifies global pattern matching\*(--that is,
  1508. + matching as many times as possible within the string.  How it behaves
  1509. + depends on the context.  In an array context, it returns a list of
  1510. + all the substrings matched by all the parentheses in the regular expression.
  1511. + If there are no parentheses, it returns a list of all the matched strings,
  1512. + as if there were parentheses around the whole pattern.  In a scalar context,
  1513. + it iterates through the string, returning TRUE each time it matches, and
  1514. + FALSE when it eventually runs out of matches.  (In other words, it remembers
  1515. + where it left off last time and restarts the search at that point.)  It
  1516. + presumes that you have not modified the string since the last match.
  1517. + Modifying the string between matches may result in undefined behavior.
  1518. + (You can actually get away with in-place modifications via substr()
  1519. + that do not change the length of the entire string.  In general, however,
  1520. + you should be using s///g for such modifications.)  Examples:
  1521. + .nf
  1522. +     # array context
  1523. +     ($one,$five,$fifteen) = (\`uptime\` =~ /(\ed+\e.\ed+)/g);
  1524. +     # scalar context
  1525. +     $/ = 1; $* = 1;
  1526. +     while ($paragraph = <>) {
  1527. +         while ($paragraph =~ /[a-z][\'")]*[.!?]+[\'")]*\es/g) {
  1528. +         $sentences++;
  1529. +         }
  1530. +     }
  1531. +     print "$sentences\en";
  1532. + .fi
  1533.   .Ip "mkdir(FILENAME,MODE)" 8 3
  1534.   Creates the directory specified by FILENAME, with permissions specified by
  1535.   MODE (as modified by umask).
  1536. ***************
  1537. *** 2802,2871 ****
  1538.   the first thing in VAR, and the maximum length of VAR is SIZE plus the
  1539.   size of the message type.  Returns true if successful, or false if
  1540.   there is an error.
  1541. - ''' Beginning of part 3
  1542. - ''' $RCSfile: perl.man,v $$Revision: 4.0.1.1 $$Date: 91/04/11 17:50:44 $
  1543. - '''
  1544. - ''' $Log:    perl.man,v $
  1545. - ''' Revision 4.0.1.1  91/04/11  17:50:44  lwall
  1546. - ''' patch1: fixed some typos
  1547. - ''' 
  1548. - ''' Revision 4.0  91/03/20  01:38:08  lwall
  1549. - ''' 4.0 baseline.
  1550. - ''' 
  1551. - ''' Revision 3.0.1.12  91/01/11  18:18:15  lwall
  1552. - ''' patch42: added binary and hex pack/unpack options
  1553. - ''' 
  1554. - ''' Revision 3.0.1.11  90/11/10  01:48:21  lwall
  1555. - ''' patch38: random cleanup
  1556. - ''' patch38: documented tr///cds
  1557. - ''' 
  1558. - ''' Revision 3.0.1.10  90/10/20  02:15:17  lwall
  1559. - ''' patch37: patch37: fixed various typos in man page
  1560. - ''' 
  1561. - ''' Revision 3.0.1.9  90/10/16  10:02:43  lwall
  1562. - ''' patch29: you can now read into the middle string
  1563. - ''' patch29: index and substr now have optional 3rd args
  1564. - ''' patch29: added scalar reverse
  1565. - ''' patch29: added scalar
  1566. - ''' patch29: added SysV IPC
  1567. - ''' patch29: added waitpid
  1568. - ''' patch29: added sysread and syswrite
  1569. - ''' 
  1570. - ''' Revision 3.0.1.8  90/08/09  04:39:04  lwall
  1571. - ''' patch19: added require operator
  1572. - ''' patch19: added truncate operator
  1573. - ''' patch19: unpack can do checksumming
  1574. - ''' 
  1575. - ''' Revision 3.0.1.7  90/08/03  11:15:42  lwall
  1576. - ''' patch19: Intermediate diffs for Randal
  1577. - ''' 
  1578. - ''' Revision 3.0.1.6  90/03/27  16:17:56  lwall
  1579. - ''' patch16: MSDOS support
  1580. - ''' 
  1581. - ''' Revision 3.0.1.5  90/03/12  16:52:21  lwall
  1582. - ''' patch13: documented that print $filehandle &foo is ambiguous
  1583. - ''' patch13: added splice operator: @oldelems = splice(@array,$offset,$len,LIST)
  1584. - ''' 
  1585. - ''' Revision 3.0.1.4  90/02/28  18:00:09  lwall
  1586. - ''' patch9: added pipe function
  1587. - ''' patch9: documented how to handle arbitrary weird characters in filenames
  1588. - ''' patch9: documented the unflushed buffers problem on piped opens
  1589. - ''' patch9: documented how to force top of page
  1590. - ''' 
  1591. - ''' Revision 3.0.1.3  89/12/21  20:10:12  lwall
  1592. - ''' patch7: documented that s`pat`repl` does command substitution on replacement
  1593. - ''' patch7: documented that $timeleft from select() is likely not implemented
  1594. - ''' 
  1595. - ''' Revision 3.0.1.2  89/11/17  15:31:05  lwall
  1596. - ''' patch5: fixed some manual typos and indent problems
  1597. - ''' patch5: added warning about print making an array context
  1598. - ''' 
  1599. - ''' Revision 3.0.1.1  89/11/11  04:45:06  lwall
  1600. - ''' patch2: made some line breaks depend on troff vs. nroff
  1601. - ''' 
  1602. - ''' Revision 3.0  89/10/18  15:21:46  lwall
  1603. - ''' 3.0 baseline
  1604. - ''' 
  1605.   .Ip "next LABEL" 8 8
  1606.   .Ip "next" 8
  1607.   The
  1608. --- 2787,2792 ----
  1609. ***************
  1610. *** 3661,3666 ****
  1611. --- 3582,3588 ----
  1612.   If SUBROUTINE is specified, gives the name of a subroutine that returns
  1613.   an integer less than, equal to, or greater than 0,
  1614.   depending on how the elements of the array are to be ordered.
  1615. + (The <=> and cmp operators are extremely useful in such routines.)
  1616.   In the interests of efficiency the normal calling code for subroutines
  1617.   is bypassed, with the following effects: the subroutine may not be a recursive
  1618.   subroutine, and the two elements to be compared are passed into the subroutine
  1619. ***************
  1620. *** 3673,3684 ****
  1621.   
  1622.   .ne 4
  1623.       sub byage {
  1624. !         $age{$a} - $age{$b};    # presuming integers
  1625.       }
  1626.       @sortedclass = sort byage @class;
  1627.   
  1628.   .ne 9
  1629. !     sub reverse { $a lt $b ? 1 : $a gt $b ? \-1 : 0; }
  1630.       @harry = (\'dog\',\'cat\',\'x\',\'Cain\',\'Abel\');
  1631.       @george = (\'gone\',\'chased\',\'yz\',\'Punished\',\'Axed\');
  1632.       print sort @harry;
  1633. --- 3595,3606 ----
  1634.   
  1635.   .ne 4
  1636.       sub byage {
  1637. !         $age{$a} <=> $age{$b};    # presuming integers
  1638.       }
  1639.       @sortedclass = sort byage @class;
  1640.   
  1641.   .ne 9
  1642. !     sub reverse { $b cmp $a; }
  1643.       @harry = (\'dog\',\'cat\',\'x\',\'Cain\',\'Abel\');
  1644.       @george = (\'gone\',\'chased\',\'yz\',\'Punished\',\'Axed\');
  1645.       print sort @harry;
  1646. ***************
  1647. *** 3842,3847 ****
  1648. --- 3764,3770 ----
  1649.       }
  1650.   
  1651.   .fi
  1652. + (This only works on machines for which the device number is negative under NFS.)
  1653.   .Ip "study(SCALAR)" 8 6
  1654.   .Ip "study SCALAR" 8
  1655.   .Ip "study"
  1656. ***************
  1657. *** 4266,4330 ****
  1658.   For more on formats, see the section on formats later on.
  1659.   .Sp
  1660.   Note that write is NOT the opposite of read.
  1661. - ''' Beginning of part 4
  1662. - ''' $RCSfile: perl.man,v $$Revision: 4.0.1.1 $$Date: 91/04/11 17:50:44 $
  1663. - '''
  1664. - ''' $Log:    perl.man,v $
  1665. - ''' Revision 4.0.1.1  91/04/11  17:50:44  lwall
  1666. - ''' patch1: fixed some typos
  1667. - ''' 
  1668. - ''' Revision 4.0  91/03/20  01:38:08  lwall
  1669. - ''' 4.0 baseline.
  1670. - ''' 
  1671. - ''' Revision 3.0.1.14  91/01/11  18:18:53  lwall
  1672. - ''' patch42: started an addendum and errata section in the man page
  1673. - ''' 
  1674. - ''' Revision 3.0.1.13  90/11/10  01:51:00  lwall
  1675. - ''' patch38: random cleanup
  1676. - ''' 
  1677. - ''' Revision 3.0.1.12  90/10/20  02:15:43  lwall
  1678. - ''' patch37: patch37: fixed various typos in man page
  1679. - ''' 
  1680. - ''' Revision 3.0.1.11  90/10/16  10:04:28  lwall
  1681. - ''' patch29: added @###.## fields to format
  1682. - ''' 
  1683. - ''' Revision 3.0.1.10  90/08/09  04:47:35  lwall
  1684. - ''' patch19: added require operator
  1685. - ''' patch19: added numeric interpretation of $]
  1686. - ''' 
  1687. - ''' Revision 3.0.1.9  90/08/03  11:15:58  lwall
  1688. - ''' patch19: Intermediate diffs for Randal
  1689. - ''' 
  1690. - ''' Revision 3.0.1.8  90/03/27  16:19:31  lwall
  1691. - ''' patch16: MSDOS support
  1692. - ''' 
  1693. - ''' Revision 3.0.1.7  90/03/14  12:29:50  lwall
  1694. - ''' patch15: man page falsely states that you can't subscript array values
  1695. - ''' 
  1696. - ''' Revision 3.0.1.6  90/03/12  16:54:04  lwall
  1697. - ''' patch13: improved documentation of *name
  1698. - ''' 
  1699. - ''' Revision 3.0.1.5  90/02/28  18:01:52  lwall
  1700. - ''' patch9: $0 is now always the command name
  1701. - ''' 
  1702. - ''' Revision 3.0.1.4  89/12/21  20:12:39  lwall
  1703. - ''' patch7: documented that package'filehandle works as well as $package'variable
  1704. - ''' patch7: documented which identifiers are always in package main
  1705. - ''' 
  1706. - ''' Revision 3.0.1.3  89/11/17  15:32:25  lwall
  1707. - ''' patch5: fixed some manual typos and indent problems
  1708. - ''' patch5: clarified difference between $! and $@
  1709. - ''' 
  1710. - ''' Revision 3.0.1.2  89/11/11  04:46:40  lwall
  1711. - ''' patch2: made some line breaks depend on troff vs. nroff
  1712. - ''' patch2: clarified operation of ^ and $ when $* is false
  1713. - ''' 
  1714. - ''' Revision 3.0.1.1  89/10/26  23:18:43  lwall
  1715. - ''' patch1: documented the desirability of unnecessary parentheses
  1716. - ''' 
  1717. - ''' Revision 3.0  89/10/18  15:21:55  lwall
  1718. - ''' 3.0 baseline
  1719. - ''' 
  1720.   .Sh "Precedence"
  1721.   .I Perl
  1722.   operators have the following associativity and precedence:
  1723. --- 4189,4194 ----
  1724. ***************
  1725. *** 4736,4742 ****
  1726.   
  1727.   .ne 10
  1728.   # a report on the /etc/passwd file
  1729. ! format top =
  1730.   \&                        Passwd File
  1731.   Name                Login    Office   Uid   Gid Home
  1732.   ------------------------------------------------------------------
  1733. --- 4600,4606 ----
  1734.   
  1735.   .ne 10
  1736.   # a report on the /etc/passwd file
  1737. ! format STDOUT_TOP =
  1738.   \&                        Passwd File
  1739.   Name                Login    Office   Uid   Gid Home
  1740.   ------------------------------------------------------------------
  1741. ***************
  1742. *** 4748,4754 ****
  1743.   
  1744.   .ne 29
  1745.   # a report from a bug report form
  1746. ! format top =
  1747.   \&                        Bug Reports
  1748.   @<<<<<<<<<<<<<<<<<<<<<<<     @|||         @>>>>>>>>>>>>>>>>>>>>>>>
  1749.   $system,                      $%,         $date
  1750. --- 4612,4618 ----
  1751.   
  1752.   .ne 29
  1753.   # a report from a bug report form
  1754. ! format STDOUT_TOP =
  1755.   \&                        Bug Reports
  1756.   @<<<<<<<<<<<<<<<<<<<<<<<     @|||         @>>>>>>>>>>>>>>>>>>>>>>>
  1757.   $system,                      $%,         $date
  1758. ***************
  1759. *** 4990,4999 ****
  1760. --- 4854,4865 ----
  1761.   .Ip $~ 8
  1762.   The name of the current report format for the currently selected output
  1763.   channel.
  1764. + Default is name of the filehandle.
  1765.   (Mnemonic: brother to $^.)
  1766.   .Ip $^ 8
  1767.   The name of the current top-of-page format for the currently selected output
  1768.   channel.
  1769. + Default is name of the filehandle with \*(L"_TOP\*(R" appended.
  1770.   (Mnemonic: points to top of page.)
  1771.   .Ip $| 8
  1772.   If set to nonzero, forces a flush after every write or print on the currently
  1773. ***************
  1774. *** 5197,5202 ****
  1775. --- 5063,5073 ----
  1776.   (Mnemonic: value of
  1777.   .B \-D
  1778.   switch.)
  1779. + .Ip $^F 8 2
  1780. + The maximum system file descriptor, ordinarily 2.  System file descriptors
  1781. + are passed to subprocesses, while higher file descriptors are not.
  1782. + During an open, system file descriptors are preserved even if the open
  1783. + fails.  Ordinary file descriptors are closed before the open is attempted.
  1784.   .Ip $^I 8 2
  1785.   The current value of the inplace-edit extension.
  1786.   Use undef to disable inplace editing.
  1787. ***************
  1788. *** 5204,5210 ****
  1789.   .B \-i
  1790.   switch.)
  1791.   .Ip $^P 8 2
  1792. ! The name that Perl itself was invoked as, from argv[0].
  1793.   .Ip $^T 8 2
  1794.   The time at which the script began running, in seconds since the epoch.
  1795.   The values returned by the
  1796. --- 5075,5083 ----
  1797.   .B \-i
  1798.   switch.)
  1799.   .Ip $^P 8 2
  1800. ! The internal flag that the debugger clears so that it doesn't
  1801. ! debug itself.  You could conceivable disable debugging yourself
  1802. ! by clearing it.
  1803.   .Ip $^T 8 2
  1804.   The time at which the script began running, in seconds since the epoch.
  1805.   The values returned by the
  1806. ***************
  1807. *** 5218,5223 ****
  1808. --- 5091,5098 ----
  1809.   (Mnemonic: related to the
  1810.   .B \-w
  1811.   switch.)
  1812. + .Ip $^X 8 2
  1813. + The name that Perl itself was executed as, from argv[0].
  1814.   .Ip $ARGV 8 3
  1815.   contains the name of the current file when reading from <>.
  1816.   .Ip @ARGV 8 3
  1817.  
  1818. *** End of Patch 7 ***
  1819. exit 0 # Just in case...
  1820. -- 
  1821. Kent Landfield                   INTERNET: kent@sparky.IMD.Sterling.COM
  1822. Sterling Software, IMD           UUCP:     uunet!sparky!kent
  1823. Phone:    (402) 291-8300         FAX:      (402) 291-4362
  1824. Please send comp.sources.misc-related mail to kent@uunet.uu.net.
  1825.