To apply, change to your perl directory, run the command above, then
apply with
patch -p1 -N < thispatch.

This is a consolidation patch. It contains many of the most commonly
applied or agreed-to patches that have been circulating since
patch.1m.

It also changes the 'unofficial patchlevel' in perl.c.

There are some problems (see items marked with '***').
I will attempt to address those in a patch.1o in a few days.

This patch contains the following packages:

My Jumbo Configure patch vs. 1m, with subsequent patches 1, 2, and 3.
Mainly, this provides easier use of local libraries, documents
the installation process in a new INSTALL file, moves important
questions towards the beginning, and improves detection of
signal names (mostly for Linux).

xsubpp-1.922.

Patches from Larry:

eval "1" memory leak patch (as modified by GSAR to apply to 5.001m).

NETaa14551 Infinite loop in formats,

NETaa13729 scope.c patch (fixed problems on AIX and others)

NETaa14138 "substr() & s///" (pp_hot.c)

Patches from ftp.perl.com:

ftp://ftp.perl.com/pub/perl/src/patches/closure-bug.patch,
version of 20 Sep 1995
Includes fix for NETaa14347 (32k limit in regex), and other
fixes.

ftp://ftp.perl.com/pub/perl/src/patches/debugger.patch,
version of 27 Aug 1995

MakeMaker-5.00. Supercedes NETaa13540 (VMS MakeMaker patches).
(Updates minimod.PL as well.)
***This has a couple of minor problems.
pod2man is run even if it isn't available.
LD_RUN_PATH gets set to some mysterious values.***

To apply, change to your perl directory, run the command above, then
apply with
patch -p1 -N < thispatch.

Highlights of this patch include:

1. Fixes for $sitelib, $d_stdio_ptr_lval, and $d_stdio_cnt_lval
when config.sh is re-used.

2. Move embed.h, keywords.h, and opcode.h dependencies to
a special regen_headers target that is ordinarily not used.
This is now analogous to the run_byacc target. As a cosmetic
side-effect, I transliterated embed_h.sh into embed.pl so that
it can run on non-unix systems as well.

3. Tests for gdbm_{sync,exists,setopt} in GDBM_File (needed for
Slackware 2.1).

For good measure, I've also thrown in the following patches I pulled
off the list, mostly unmodified from the originals.

4. Spider's suggested renaming of regexec to pregexec and regcomp to
pregcomp to avoid conflicts with POSIX symbols on Digital Unix.
(I only added a brief explanatory comment to the relevant .c
files.)

5. Spider's installperl patch to avoid installing *.orig and and the
.exists files. (I changed this a little to include patch's ~
suffix, which is used on systems with short file names (in some
versions of patch)).

6. Raphael's "safe_unlink" patch to installperl, in case a copy
of perl is currently runniung.

This patch brings you MakeMaker-4.15. This is MakeMaker-4.13 plus
patches to provide the LD_RUN_PATH environment variable for building
shared libraries, and the appropriate -I flags for running xsubpp
while building perl.

To apply, change to your perl directory, run the command above, then
apply with
patch -p1 -N < thispatch.

To apply, change to your perl directory, run the commands above, then
apply with
patch -p1 -N < thispatch.

After you apply this patch, I would recommend:
rm config.sh
sh Configure [whatever options you use]
make depend
make
make test

Here are the highlights:
All pod documentation now installed, along with corresponding man
pages, if possible (Configure allows you to change this).

cppstdin no longer points back to the build directory. This
necessitated two changes to the test suite: comp/cpp.t is now a
front end that punts if cppstdin is not yet available (the old
perl4 trick doesn't work for perl5). The op/misc.t test
./perl -P -e 'use POSIX;' has been dropped since I couldn't think
of an elegant way to bypass it for systems that need the cppstdin
wrapper.

Grand autoload patch included (minus the installperl, lib/, and
ext/ changes). The lib/ changes are in patch.1g, and the
ext/ changes are in patch.1h.

This is my patch patch.1d for perl5.001. A complete description is
given below, but here are the basic changes.

1. Linux: more tweaks so dynamic loading works under ELF
or (maybe) under dld. There are so many different dld versions
and so many different tool sets, it's hard to be more specific.
2. perl -e '$v=1e19+0' no longer dumps core on Intel x86
processors.
3. pod stuff:
a. Wrapped pod2* translators in a 'SH' wrapper so that they
have the proper path to perl at the top.
b. Fixed pod/ Makefile to call the pod2html translator
correctly. (Why do pod2man and pod2html work differently?)
c. Include latest (Feb 2, 1995) version of pod2html, fresh from
ftp.metronet.com.
4. MakeMaker 4.093.
5. GIMME and installperl patches from Tim Bunce.
6. Miscellaneous hint file updates.

Configure
Allow ' ' to mean 'none' in a few more places. This provides
a way for hint files to set something to an empty value and to
ensure that the empty value will be maintained when config.sh is
reused.

Fix silly ld typo that prevented hint file from actually setting
$ld.

MANIFEST
Now has pod/pod2*.SH.

Makefile.SH
Remove old libperl.a instead of blindly adding to it. Failure to
do this causes a problem if you originally used perl's malloc but
later changed your mind. The old malloc.o would still be in
libperl.a

ext/DynaLoader/dl_dlopen.xs
Use strerror(errno) instead of dlerror for NetBSD.

handy.h
Clarify & rework HAS_BOOL comments and code. No functionality is
changed, but I hope this is easier to follow.

installperl
Run ranlib on installed .a libraries.
unlink() old versions of files before installing new ones, in
case the old ones are are write-protected.

lib/ExtUtils/MakeMaker.pm
Updated to 4.092 by Andreas Koenig. This features better
selection of shared library versions and shorter command lines for
static linking of new extensions. It is also more robust against
broken csh on Linux. (There's still a glob in the library
selection loop, however.)

I further updated it to 4.093 because I didn't like the
distclean target :-). It's just a sloppy quick fix, but that's
all I have time for now. I've also worked on the library version
selection stuff and the $(CC) command stuff a little more.

Configure
Updated to dist PL53.
Fix overlapping memcpy test.
Add check for ld. Use $cc instead, if on an ELF system.
With -d, don't reuse config.sh unless $myuname matches.
Warn more explicitly about changing compilers before reloading
old config.sh.
Detect Linux ELF format in nm scan.
Better detection of d_castneg. (ISC 4.1 was passing the test,
but couldn't cast in an argument list.)
Suggest -fpic for dynamic loading if you're using GNU CC under any
name.
No longer test for byacc, fmod, or drem, since they are not used.

README
Suggest using -Dcc=gcc (or whatever).
Warn about reusing old config.sh. (The warning was already there
in 5.001; I've just expanded it a little.)
Warn against using GNU as and GNU ld on SunOS & Solaris.

util.c
Simplified cast_i32() and cast_iv() to mimic what *actually*
happens on a SPARC running SunOS 4.1.3. (Previously, they did
some complicated fmod() calculation. I've since discovered that's
not what happens on the SPARC.)

With this change, fmod() is no longer necessary. Hence my_fmod
is removed. This also means the HAS_FMOD and HAS_DREM tests are
no longer needed in Configure, so they are gone too.

[Actually, that's a lie. This is just a reposting of two of my
patches (removing some byacc dependencies and fixing some set*id
stuff) + one version of the x2p/walk.c emit_split() patch.
I've just usurped the letter 'b' to fit in my patch sequence.
You probably have already applied these as well, but again here they
are all packaged up nice and neatly for storage on ftp sites.]

Here's one possible solution to the byacc problem. Short summary:
make will think your perly.[ch] are out of date because perly.c.diff
has changed. They aren't really out of date, but the ordering of the
timestamps in the distribution fools make. I had put some traps in
perly.fixer to check to make sure that everything got run only if
you ran the same version of byacc (1.8) as Larry, but the traps aren't good
enough: There's a Cygnus version of byacc out there that also calls
itself 1.8 (with a +Cygnus xxx note attached). I don't think I'll
ever be able to reliably detect all mutant byacc's, so the safest
course of action seems to be to never run byacc.
(Yes, the perly.fixer check could be a _lot_ smarter. Volunteers?)

This simple-minded fix just puts in a
perly.c: perly.y
- touch perly.c
perly.h: perly.y
- touch perly.h
to bring perly.[ch] up to date, if needed.
The '-' are in case your source is read-only.

It also does the same trick in x2p/Makefile.SH.

WARNING! Danger! Larry, if you do this, it means you have to
explicitly call
make run_byacc
whenever you change perly.y, perly.c.diff, or
cd x2p; make run_byacc
if you change x2p/a2p.y.

Okay, I understand how this one happened. This is a case where a
beneficial fix uncovered a bug elsewhere. I changed the constant
folder to prefer integer results over double if the numbers are the
same. In this case, they aren't, but it leaves the integer value there
anyway because the storage is already allocated for it, and it *might*
be used in an integer context. And since it's producing a constant, it
sets READONLY. Unfortunately, sv_2pv() bogusly preferred the integer
value to the double when READONLY was set. This never showed up if you
just said

This patch addresses only Configure and build issues for which I have
tested solutions. It does nothing else. Maybe some of the other patches
floating around should be included. Maybe not. I'm afraid I just
don't have time to think about them now.

Unless something's broken, I hope not to issue any more patches :-)
(Yes, I've said that before, but this one's _really_ small, and linux
support was broken.:-) Thanks to Kenneth Albanowski for researching,
implementing, and testing the Linux patch.

This is my patch patch.0m for perl5.000.
This patch fixes all remaining problems that I am aware of, and for
which I have a solution. It also updates some hint files and
documentation.

Here's what's new:

Configure
Protect against spaces in uname -m output (unicos).
Look in <stdlib.h> for malloctype and freetype.
Check if user has void free() or int free().
Look in linux/signal.h for signal names.

MANIFEST
MANIFEST.new
Two new hint files: cxux.sh and PowerUNIX.sh.
Sorted.

README
Indicate what gets installed and where it usually goes.
Thanks to Hallvard B. Furuseth <h.b.furuseth@usit.uio.no>
for suggesting this.

U/Myinit.U
Update extliblist comment.

U/dist3_051.pat
This file contains patches to dist 3 (PL 51) that I used to generate
Configure for perl.

U/mallocsrc.U
Look in <stdlib.h> for malloctype and freetype.
Check if user has void free() or int free().

config_h.SH
config.H
Add Free_t to handle void free() vs. int free().

ext/DynaLoader/README
Updated comment.

ext/POSIX/POSIX.pm
creat() has 2 arguments, not 3 (thanks, Paul).

ext/POSIX/POSIX.xs
Fix return type of lseek.

ext/SDBM_File/sdbm/sdbm.h
Add I_STDLIB guard on #include <stdlib.h>

ext/util/extliblist
Add note indicating this is obsolete. Don't remove it because
people might be using it for their own private extensions.

hints/PowerUNIX.sh
hints/cxux.sh
New files. Written by Tom.Horsley@mail.hcsc.com

hints/linux.sh
Simplified.

lib/ExtUtils/MakeMaker.pm
Typo fixed, only affected aix?

malloc.c
Allow for possible int free().

perl.h
pp_sys.c
util.c
If the user is not using vfork, move the #define vfork fork
util after various #include files. Since vfork() and fork() might
have different prototypes, the #define could cause a conflict in
system header files. (Reported for 386bsd.)

Makefile.SH
make realclean will remove h2xs and makeaperl (but leave behind
the .SH versions, of course).

Configure
Generated by metaconfig PL 51.
Correctly set ./mips on a MIPS system.
Improved (we hope) handling of $archname.
MANIFEST
MANIFEST.new
Made .SH files out of h2xs and makeaperl so that they get the
correct path-to-perl at the top.
Makefile.SH
Propagate $(perllib) to extensions.
U/dist3_051.patches
Two patches to apply on top of metaconfig PL 51. I've sent
them off for inclusion in the next metaconfig update.
config_h.SH
config.H
Regenerated. Only the order of elements has changed.
ext/DB_File/Makefile.PL
ext/GDBM_File/Makefile.PL
ext/NDBM_File/Makefile.PL
Add -L/usr/local/lib to LIBS variable.
ext/POSIX/POSIX.xs
Place #ifdef around FD_CLOEXEC (needed for Apollo).
ext/SDBM_File/sdbm/Makefile.PL
Simplified, thanks to MakeMaker enhancements.
ext/util/make_ext
Pass through $(perllib) argument for cflags.
h2xs.SH
Changed from h2xs to h2xs.SH. Now finds correct path to perl.
hints/next_3_2.sh
Updated for hppa.
hints/solaris_2.sh
Remove potentially problematic -lmalloc from $libswanted.
hints/unicos.sh
Look in /usr/include/rpcsvc for dbm.h.
installperl
Install h2xs.
lib/Cwd.pm
Use 'my' variable to avoid clobbering $_.
lib/ExtUtils/MakeMaker.pm
Upgraded from 4.06 to 4.085.
Lots of documentation improvements.
EXE_FILES to refer to an array of executable files to install.
Reduce chatter during build process.
Don't count a useful -L/path option as a successful search for
a particular library.
Cleanup handling of aix external symbols.
Create/update perllocal.pod to indicate what we've done.
makeaperl.SH
Changed from makeaperl to makeaperl.SH. Now finds correct path
to perl.
x2p/util.c
Delete unused setenv() and envix() functions.
x2p/util.h
Delete unused setenv() and envix() prototypes.
vms/config.vms
Define I_SYS_STAT and I_SYS_TYPES.

perl5.000 patch.0k: MakeMaker 4.06 and to fix minor portability and build problems reported even after patches 0a through 0j

MakeMaker 4.06 allows you to build extensions away from the source
tree with either static or dynamic loading.

In a rare act of prescience, I've also fixed some un-reported bugs.
Specifically, there were several places where Configure said you could
specify things using ~name notation, but, in fact, you couldn't.

Makefile.SH
Some trailing ' ' removed from lines.
New target lib/ExtUtils/Miniperl.pm built. This stashes away
miniperlmain.c in the library so new static extensions can be
built away from the source tree.
Minor cleanup.

U/Oldconfig.pat.2
This is a patch to be applied against dist-PL 50 to upgrade
the DEC OSF/1 version detection.

U/archlib.U
Preserve previous value for $archname. Otherwise this is
identical to the unit in dist-PL 50.

U/dlsrc.U
Users may not use ~name notation to find the dynamic loading
module. (Back in early alpha days they could, but that hasn't
worked since the DynaLoader module was introduced.

config.H
Updated.

config_h.SH
Updated.

hints/dec_osf.sh
Updated. Simplified. Don't use ld -no_archive (at least as
the default). It only worked because some versions *ignored* it.

Configure
Regenerated with metaconfig patchlevel 50. This changed
a variety of things, mostly related to selecting and changing
the installation prefix.
Handle csh, sed, and byacc no matter what the setting of
d_portable. (This was causing glob problems in patch.0i).
Set d_portable to default to 'y'. It doesn't matter anyway,
but gives people a warm fuzzy feeling.
Remove useless d_group and d_passwd tests.
Add check for <sys/stat.h>.
Improve & generalize AIX version detection.
Consider /opt/man/man1 as a possible place to install man pages.
Be a little more robust about OS version changes when deciding
if the output of uname -a has really changed.

MANIFEST
MANIFEST.new
Added hints/mpeix.sh.

README
Tell users the Configure defaults are probably right.

Makefile.SH
Better detection of whether user has byacc.
Use $(MAKE) instead of make.

U/Loc_sed.U
Works again with d_portable='define'.

U/Myinit.U
Set d_portable=define as default.

U/d_byacc.U
Detect whether user has byacc even if d_portable=define.

U/d_csh.U
Works again with d_portable='define'.

U/d_group.U
Empty file to avoid useless metaconfig test.

U/d_passwd.U
Empty file to avoid useless metaconfig test.

U/dist.patch
This file contains two minor updates to dist3 PL50 that were used
to generage Configure.

handy.h
Protect agains g++-2.6.3, which predefines bool. g++ can be
used to compile an extension, but not perl itself. Still, the
extension will #include "perl.h", which eventually gets
"handy.h", which #define's bool. If this happens to you, add
-DHAS_BOOL to your ccflags in your extension, or else ensure that
_G_config.h is #include'd before perl.h. (_G_config.h will define
_G_HAVE_BOOL, if indeed your version of g++ has bool.)

This patch does the following things:
1. Fix various bonehead errors I introduced in patches a-g.
2. Incorporate MakeMaker changes to bring it up to version 4.01 (mostly).
3. Stick in things I forgot in patches a-g (e.g. AIX).
4. Some minor additional cleanup in x2p/ for even pickier compilers.
5. More hints updates (hpux and next).
6. Include newest dl_hpux.xs.

I didn't have time to
1. Fix the overlapping strcpy() in op.c
2. Restore h2xs to Larry's original design to process <>.
3. take out unnecessary "use Config" in installperl.
4. Add in vms patches.

I forgot to
[If I remembered what i forgot, I wouldn't have forgotten it. :]

Makefile.SH
Build extension libraries right into lib/auto/whatever.
Don't set CCCDLFLAGS since we don't use it anyway.
Take care to avoid modifying lib/Config.pm without reason
Visit DynaLoader for `make clean'. (Previously only did
so for `make realclean'.)
@echo "Note that make realclean does not delete config.sh"
Include config.h dependency.

In article <3ekgoo@giga.bga.com> jamshid@ses.com (Jamshid Afshar) writes:
: I'm getting some unexpected behavior for a small perl script on SunOS
: 4.1.3 perl 4.0p36. The same script crashes under perl 5.0 on HP-UX.
: That script is at the end of this article -- it's as small as I could
: make it and still reproduce the crash.

: I am on a Sun sparc running Solaris 5.3 / 5.4
:
: Are there any patches available for perl5.000, or a list of know bugs?
: I am having problems with a script running out of memory, which may be
: causes by memory leaks. The process size grows steadily up to approx
: 8Meg (over a couple of minutes) an then grows to approx 22Meg (in 2 or
: 3 seconds) before running out of memory. purify indicates memory
: leaks, but I am not sure whether this is as a result of perl
: abandoning memory as it exits.

5.001 will contain fixes for a number of memory leaks. Here are some
unofficial patches for some of the more spectacular ones. The one
for sv.c is the likeliest one to be affecting you, unless you're doing
a lot of evals.

In order to fix the duplicate DESTROY bug, I need to remove [the
modified] lines from sv_setsv.

Basically, copying an object shouldn't produce another object without an
explicit blessing. I'm not sure if this will break anything. If Ilya
and anyone else so inclined would apply this patch and see if it breaks
anything related to overloading (or anything else object-oriented), I'd
be much obliged.

By the way, here's a test script for the duplicate DESTROY. You'll note
that it prints DESTROYED twice, once for , and once for . I don't
think an object should be considered an object unless viewed through
a reference. When accessed directly it should behave as a builtin type.

This patch incorporates various portability fixes and uses the latest
metaconfig to generate Configure (and config_h.SH).

It would take a long time to summarize all that I've changed. I
haven't included many code changes because I'm trying *not* to
duplicate bug fixes Larry may already have applied.

Here's an older description I prepared that's still mostly accurate:

I've also included a few portability fixes in the main source, but
these are certainly not a complete set of everything that's been
reported.

Don't be put off by the size of the patch. Mostly, it's just
rearrangement of the parts in Configure and some cosmetic changes.

Since gcc often supports long long, I had started to add quad support
to Configure. Since SunOS 4.1.3 defines a conflicting "quad"
structure, I changed the name from 'quad' to Quad_t, consistent with
other Configure "types." I also changed "QUAD" to "HAS_QUAD".
However, it turns out it's pretty hard to actually *use* Quad_t.
Neither system I have access to can sprintf() a "long long", nor can
they carry one around in an IV, unless I make IV "long long", which I
didn't want to force generally. Thus I wonder whether any but a
precious few could actually use Quad_t, and dropped the tests from
Configure. I left in the s/quad/Quad_t/ and s/QUAD/HAS_QUAD/ stuff in
case someone else wants to pick it up, and also because I was too lazy
to take it back out :-).

Some highlights:

Configure
Several new options. Use Configure -h to learn more. Also,
read the directions Configure prints. :-)
Spaces now allowed in -D command line options.
New -O option that overrides config.sh.
You can start interactively and then change that to accepting
all the defaults by specifying &-d at any Configure prompt. This
is useful if you have to re-run Configure to only change a few
settings.
Signal type set correctly for the cast{i32,neg} tests.
archname detection improved a bit
guard against ksh users who have set -u
Oldconfig.U cleaned up and regularized a bit more.
Guard against hint files using (and over-writing) $tmp.
Command line options now are processed after metaconfig INIT
lines. Thus things like Configure -Uuseposix should work now.
Various miscellaneous clean-ups.
better use/detection of tr.
i_db.U now checks for hash and prefix type (I think!) I can't
test it here.
i_?db*.U now all check for an associated function before deciding
to include or not the header.
MANIFEST
MANIFEST.new
Sorted & updated.
Makefile.SH
Some shells/makes bombed out on test -d lib/auto || mkdir lib/auto
Use makedir instead.
README
Some additional notes that people won't read :-).
cflags.SH
Now calls $startsh. Weird things were happening on Intergraph,
and this might be related.
config.H
Updated.
config_h.SH
Regenerated.
deb.c
Varargs dependencies on STANDARD_C replaced by I_STDARG.
doop.c
quad stuff.
ext/DB_File/DB_File.xs
Use the new DB_Hash_t and DB_Prefix_t symbols.
ext/SDBM_File/sdbm/sdbm.h
Fix #defines to be more robust.
mg.c
Replace VOIDSIG by metaconfig's Signal_t.
opcode.h
opcode.pl
semop only takes 2 arguments, not 3.
perl.c
Better guard on getenv() prototype. A hint file can use this, if
necessary. Me, I think some compilers are just too picky.
perl.h
The (very) beginnings of some Quad support. See above.
Remove the very troublesome sprintf() prototype. Since we don't
_use_ the return value anyway (since it's not portable) this
should be o.k. The problem was that some systems CAN_PROTOTYPE
but include char *sprintf(); in <stdio.h>. That's incompatible
with the version we used to have in perl.h. Most people have
a prototype for sprintf() in <stdio.h>. Those that don't probably
can get by without it anyway.
Protect the timesbuf by the specific HAS_TIMES test. Some older
gcc-2.something/Solaris 2.something installations apparently don't
have times.
pp.c
More quad stuff.
pp_ctl.c
s/STANDARD_C/I_STDARG/ for varargs stuff.
pp_sys.c
use Signal_t.
proto.h
Update to match new metaconfig names.
util.c
s/STANDARD_C/I_STDARG/ for varargs stuff.
comment out <unistd.h>. A pause prototype was causing problems on
some systems.
vms/config.vms
Changed to use Signal_t.

This patch enables metaconfig (PL48) users to regenerate Configure. A few
of the units are considerably enhanced from those distributed with
perl5.000. (This patch assumes that you do *not* have the units from
perl5beta3i installed. Sorry if that's an inconvenience.)

In particular, *dbm testing also checks for an appropriate
library function, not just the right header files.

The dynamic loading unit U/dlsrc.U has also been updated to support
SVR4 dynamic loading.

The U/i_db.U unit now checks for the types for the various structure
members that have been causing problems.

Note that at a minimum, you need to be sure you have
the cext='.xs' line from this .package file in your own. That tells
metaconfig that it should look in .xs files (as well as the usual
.[chy] files) for C symbols.

I've also updated Makefile.SH to know that the byacc-generated a2p.c
is now included with the distribution so that we no longer need to go
looking for yacc/bison/byacc and deal with various library issues or
command line options to support those various compiler compilers.

I've included a2p.c generated by byacc-1.9. Larry, feel free to
use your own from byacc-1.8 instead.

This patch consolidates most of the hint file updates I've been
collecting since perl5.000's release. Some of the updates don't make
any sense until you also apply the Configure patches in patch.0g.
(A few late arrivals are also in patch.0g.)

Most, if not all, the MakeMaker support for no perl source
is now included. Recent ld and mkbootstrap patches applied.
-lX11_s suffix fix applied.

- Makefile.SH

Fix nested module problem which affected make_ext

- ext/DynaLoader/DynaLoader.pm

Change error message to
"Can't load module $module, dynamic loading not available in this perl"

- ext/util/make_ext

A very minor tweak to allow for Deeply::Nested::Modules

- h2xs

Major reorganisation. Mainly aimed at simplifying for later
enhancements. The constant() and AUTOLOAD functions can no
longer be individually enabled or disabled - it never made
any sense - they need each other. Header file parsing code
has been simplified (may allow prototypes to be parsed later).
The .pm file always inherits from AutoLoader.

I hope not to issue another MakeMaker patch till after Perl5.001!

If you want to play with the (as yet untested) no-perl-source mechanism
you'll need to start by doing something like this:

And then try executing Makefile.PL away from (not under) the perl
source code. You should get a 'Unable to locate perl source' warning
and the PERL_SRC macro will be undefined. Let me know how it goes but
be aware that any problems/fixes are unlikely to turn up in an official
MakeMaker patch till after Perl5.001.

*Please* test this patch and report your findings back to the list so
Larry knows that all is well (or not :-).

- A previous small patch to DynaLoader .bs handling with one addition:
! if (-f $bs) {
! if (-s $bs) { # only read file if it's not empty

- A recently posted patch to hints/aix.sh (with cosmetic changes).

Hopefully no further changes to MakeMaker will be needed before perl5.001.
If any changes are required I intend that they will be release as patches
to be applied over this one. This is the last MakeMaker jumbo patch for
perl5.000.

Patch and enjoy.

Regards,
Tim Bunce.

p.s. I'll be around until about 4pm GMT tomorrow (Tuesday), after that
I'm off for Christmas. This has been a great year for me. I have very
much enjoyed working with the perl5-porters and I wish you all a
wonderful and merry Christmas and a very happy New Year.

[editor's note: the sparc executables have not been included,
and emacs backup files and other cruft such as patch backup files have
been removed. This was reconstructed from a tarball found on the
September 1994 InfoMagic CD]

[editor's note: the sparc executables have not been included, and
emacs backup files have been removed. This was reconstructed from a
tarball found on the September 1994 InfoMagic CD; the date of this is
approximate]

ENHANCEMENTS
Subject: relaxed requirement for semicolon at the end of a block
Subject: scalar keys %array now counts keys for you
Subject: added ... as variant on ..
Subject: get*by* routines now return something useful in a scalar context
Subject: form feed for formats is now specifiable via $^L
Subject: PERLLIB now supports multiple directories
Subject: paragraph mode now skips extra newlines automatically

MANPAGE
Subject: documented that numbers may contain underline
Subject: clarified that DATA may only be read from main script
Subject: documented need for 1; at the end of a required file
Subject: extended bracket-style quotes to two-arg operators: s()() and tr()()
Subject: documented PERLLIB and PERLDB
Subject: documented limit on size of regexp

COMPILER
Subject: various error messages have been clarified
Subject: the switch optimizer didn't do anything in subroutines
Subject: clarified debugging output for literals and double-quoted strings
Subject: new warning for use of x with non-numeric right operand
Subject: illegal lvalue message could be followed by core dump
Subject: new warning for ambiguous use of unary operators
Subject: eval "1 #comment" didn't work
Subject: semantic compilation errors didn't abort execution
Subject: an expression may now start with a bareword
Subject: if {block} {block} didn't work any more
Subject: "$var{$foo'bar}" didn't scan subscript correctly
Subject: an EXPR may now start with a bareword
Subject: print $fh EXPR can now expect term rather than operator in EXPR
Subject: new warning on spurious backslash
Subject: new warning on missing $ for foreach variable
Subject: "foo"x1024 now legal without space after x
Subject: new warning on print accidentally used as function
Subject: 2. now eats the dot
Subject: <@ARGV> now notices @ARGV
Subject: tr/// now lets you say \-

I/O
Subject: new warnings for failed use of stat operators on filenames with \n
Subject: wait failed when STDOUT or STDERR reopened to a pipe
Subject: end of file latch not reset on reopen of STDIN
Subject: seek(HANDLE, 0, 1) went to eof because of ancient Ultrix workaround
Subject: h_errno now accessible via $?

DEBUGGER
Subject: support for MSDOS folded into perldb.pl
Subject: perldb couldn't debug file containing '-', such as STDIN designator
Subject: the debugger now warns you on lines that can't set a breakpoint
Subject: the debugger made perl forget the last pattern used by //
Subject: fixed double debug break in foreach with implicit array assignment
Subject: debugger sometimes displayed wrong source line

TRANSLATORS
Subject: find2perl assumed . in PATH
Subject: find2perl didn't output portable startup code
Subject: find2perl didn't always stat at the right time
Subject: s2p didn't output portable startup code
Subject: s2p didn't translate s/pat/\&/ or s/pat/\$/ or s/pat/\\1/ right
Subject: in a2p, getline should allow variable to be array element
Subject: in a2p, now warns about spurious backslashes
Subject: in a2p, now allows [ to be backslashed in pattern
Subject: in a2p, now allows numbers of the form 2.
Subject: in a2p, simplified the filehandle model
Subject: in a2p, made RS="" translate to $/ = "\n\n"
Subject: in a2p, do {...} while ... was missing some reconstruction code

This is the only enhancement in this patch, but it seemed unlikely
to bust anything else, and added functionality that it was very
difficult to do any other way. Compliments of David W. Sanderson.

Subject: op/regexp.t failed from missing arg to bcmp()
Subject: study was busted by 4.018
Subject: sort $subname was busted by changes in 4.018
Subject: default arg for shift was wrong after first subroutine definition

Things that broke in 4.018. Shame on me.

Subject: do {$foo ne "bar";} returned wrong value

A bug of long standing. How come nobody saw this one? Or if you
did, why didn't you report it before now? Or if you did, why did
I ignore you? :-)

This set of patches doesn't have many enhancements but this is
one of them. The eval operator has two distinct semantic functions.
First, it runs the parser on some random string and executes it.
Second, it traps exceptions and returns them in $@. There are times
when you'd like to get the second function without the first. In
order to do that, you can now eval a block of code, which is parsed
like ordinary code at compile time, but which traps any run-time
errors and returns them in the $@ variable. For instance, to
trap divide by zero errors:

eval {
$answer = $foo / $bar;
};
warn $@ if $@;

Since single-quoted strings don't ever change, they are optimized
to the eval {} form the first time they are encountered at run-time.
This doesn't happen too often, though some of you have written things
like eval '&try_this;'. However, the righthand side of s///e is
evaluated as a single-quoted string, so this construct should run
somewhat faster now.

Subject: added sort {} LIST

Another enhancement that some of you have been hankering for.
You can now inline the sort subroutine as a block where the
subroutine name used to go:

@articles = sort {$a <=> $b;} readdir(DIR);

Subject: added some support for 64-bit integers

For Convexen and Crayen, which have 64-bit integers, there's
now pack, unpack and sprintf support for 64-bit integers.

Subject: sprintf() now supports any length of s field

You can now use formats like %2048s and %-8192.8192s. Perl will
totally bypass your system's sprintf() function on these. No,
you still probably can't say %2048d. No, I'm not going to
change that any time soon.

Subject: substr() and vec() weren't allowed in an lvalue list
Subject: extra comma at end of list is now allowed in more places (Hi, Felix!)
Subject: underscore is now allowed within literal octal and hex numbers

A larger percentage of this update consists of code to do
consistent ctype processing whether or not <ctype.h> is 8-bit
clean.

Subject: /$foo/o optimizer could access deallocated data
Subject: certain optimizations of //g in array context returned too many values
Subject: regexp with no parens in array context returned wacky $`, $& and $'
Subject: $' not set right on some //g
Subject: grep of a split lost its values
Subject: # fields could write outside allocated memory
Subject: length($x) was sometimes wrong for numeric $x

Recently added or modified stuff that you kind of expect to be
a bit flaky still. Well, I do...

More substitutions can be done in place now because Perl knows
that patterns like in s/foo\s+bar/1234567/ have to match a
certain number of characters total. It used to be on that
particular pattern that it only knew that it had to match at
least 3 characters. Now it know it has to match at least 7.

Subject: multiple reallocations now avoided in 1 .. 100000

You still don't want to say 1 .. 1000000, but at least it will
refrain from allocating intermediate sized blocks while it's
constructing the value, and won't do the extra copies implied
by realloc.

Subject: indirect subroutine calls through magic vars (e.g. &$1) didn't work
Subject: defined(&$foo) and undef(&$foo) didn't work
Subject: certain perl errors should set EBADF so that $! looks better
Subject: stats of _ forgot whether prior stat was actually lstat
Subject: -T returned true on NFS directory
Subject: sysread() in socket was substituting recv()
Subject: formats didn't fill their fields as well as they could
Subject: ^ fields chopped hyphens on line break
Subject: -P didn't allow use of #elif or #undef
Subject: $0 was being truncated at times
Subject: forked exec on non-existent program now issues a warning

Various things you'd expect to work the way you expect, but
didn't when you did, or I did, or something...

Subject: perl mistook some streams for sockets because they return mode 0 too
Subject: reopening STDIN, STDOUT and STDERR failed on some machines

People who used cppstdin for the cpp filter or who had their
umask set to 700 will now be happier. (And Configure will now
prefer /lib/cpp over cppstdin like it used to. If this gives
your machine heartburn because /lib/cpp doesn't set the symbols
it should, write a hints file to poke them into ccflags.)

Subject: initial .* in pattern had dependency on value of $*

An initial .* was optimized to have a ^ on the front to avoid retrying
when we know it won't match. Unfortunately this implicit ^ was
paying attention to $*, which it shouldn't have been.

Subject: certain patterns made use of garbage pointers from uncleared memory

You can now use -w (more) profitably on programs that require
other files. I figured if you mistype a subroutine name you'll
get a fatal error anyway, unlike a variable, which just defaults
to being undefined.

Subject: pack(hh,1) dumped core
Subject: read didn't work from character special files open for writing
Subject: close-on-exec wrongly set on system file descriptors
Subject: //g only worked first time through
Subject: perl -v printed incorrect copyright notice
Subject: certain pattern optimizations were botched
Subject: documented some newer features in addenda
Subject: $) and $| incorrectly handled in run-time patterns
Subject: added tests for case-insensitive regular expressions
Subject: m'$foo' now treats string as single quoted

Subject: Configure now handles defaults much better
Subject: Configure now knows if config.sh was built on this machine
Subject: Configure now checks file existence more efficiently
Subject: Configure now handles stupid SCO csh

Configure has been heavily revised. Many of the tests that used
to simply force a decision now check that decision against the
previous value of the variable, and offer to let you change it.
The default now is to keep the old value, so that you don't lose
information from your previous run.

Because of this, it's now more important to know whether, in fact,
config.sh was produced on this machine and on this version of
the operating system. config.sh now contains a lastuname variable
which contains the output of uname -a. If this matches the current
output of uname -a, Configure defaults to including the old config.sh.
Otherwise not. If there is no valid config.sh, then Configure looks
defaults for the current architecture in the hints/ subdirectory
instead. The guesswork I've done in this section of code is
phenomenal, so you'll have to instruct me where I've misparsed
the output of uname (a problem in portability all of its own).

Configure was assuming that the array of values returned from
getgroups was the same type as the gids returned by other system
calls. Unfortunately, reality set in. Likewise for malloc() and
sprintf(), which there is only one portable way to find out the return
value of: try it one way or the other, and see if it blows up.

Certain compilers and/or optimizers get bozoed out by large
compilation units, or by large structures within those units.
Previously, you either had to change the compiler flags for all
the files, or do hairy editing in Makefile.SH and remake the Makefile,
necessitating a make depend. Now there is a script called cflags.SH
whose duty it is to return the proper CFLAGS for any given C file.
You can change the flags in just one spot now and they will be
immediately reflected in the next make (or even in the current
make, if one is running). Eventually I expect that any of the hints
files could modify cflags.SH, but I haven't done that yet.

The particular problem of long jump offsets in eval.c has been at
least partially alleviated by locating some of the labels in the
middle of the function instead of at the end. This still doesn't
help the poor Vax when you compile with -g, since it puts a jump
to the end of the function to allocate the stack frame and then
jumps back to the beginning of the function to execute it. For
now Vaxen will have to stick with -O or hand assemble eval.c and
teval.c with a -J switch.

These are problems that were reported on the net and had unofficial
patches. Now they have official patches. Be sure to patch a
copy of your files without the unofficial patches, or the patch
program will get confused.

Subject: you may now use "die" and "caller" in a signal handler

Someone pointed out that using die to raise an exception out
of a signal handler trashed the expression value stack if the
exception was caught by eval. While fixing that, I also fixed
the longstanding problem that signal handlers didn't have a normal
call frame, which prevented the caller function from working.

The open function returns undef on failed implicit forks. The Book
assumed that the same was true of an explicit fork. I've made the
function behave like the Book says. It's a pity there's no way
to have an undefined value that returns -1 in a numeric context
but false in a boolean context...

Subject: generalized the yaccpar fixer some

Thanks to Andy Dougherty, perly.fixer now knows how to fix SVR3 2.2's
yaccpar code to do dynamic parse stack allocation. He also made it
easy for other people to insert their code there. Hooray!

Subject: find2perl sometimes needs to stat on the 2nd leg of a -o
Subject: find2perl didn't correctly handle switches with an argument of 0

In attempting to delay the lstat to the last moment, in case a filename
could be rejected on the basis of its name, find2perl neglected to
take into account the fact that control might pass to the 2nd half
of a -o without executing all of the 1st half, in particular without
executing the lstat.

find2perl was wisely removing leading zeroes from numbers that would
mistakenly be interpreted as octal numbers by Perl. Unfortunately,
this caused it to delete the number 0 entirely.

Most of these patches are pretty self-explanatory. Much of this
is random cleanup in preparation for version 4.0, so I won't talk
about it here. A couple of things should be noted, however.

First, there's a new -0 option that allows you to specify (in octal)
the initial value of $/, the record separator. It's primarily
intended for use with versions of find that support -print0 to
delimit filenames with nulls, but it's more general than that:

null
^A
default
CR
paragraph mode
file slurp mode

This feature is so new that it didn't even make it into the book.

The other major item is that different patchlevels of perl can
now coexist in your bin directory. The names "perl" and "taintperl"
are just links to "perl3.044" and "tperl3.044". This has several
benefits. The perl3.044 invokes the corresponding tperl3.044 rather
than taintperl, so it always runs the correct version. Second, you can
"freeze" a script by putting a #! line referring to a version that
it is known to work with. Third, you can put a new version out
there to try out before making it the default perl. Lastly, it
sells more disk drives. :-)

Barring catastrophe, this will likely be the last patch before
version 4.0 comes out.

Here's the requisite dinky patch to fix the problems of the
preceding large set of patches. In this case, a couple of
malloc/free problems--one of which involved overrunning the end
of an allocated string, and the other of which involved freeing
with invalid pointers. (There was also a bug in there involving
variable magicalness propagating incorrectly, which resulting in
a dbm anomoly.)

I updated README to mention that dnix needs to avoid -O.

I added the hp malloc union overhead strut that Jan Dr{rv posted.
(Eventually this should be determined by Configure, but laziness
has its advantages.)

This set of patches pretty much brings you up to the functionality
that version 4.0 will have. The Perl Book documents version 4.0.

Perhaps these should be called release notes... :-)

Enhancements:

Many of the changes relate to making the debugger work better.
It now runs your scripts at nearly full speed because it no longer
calls a subroutine on every statement. The debugger now doesn't
get confused about packages, evals and other filenames. More
variables (though still not all) are available within the debugger.

Related to this is the fact that every statement now knows which
package and filename it was compiled in, so package semantics are
now much more straightforward. Every variable also knows which
package it was compiled in. So many places that used to print
out just the variable name now prefix the variable name with the
package name. Notably, if you print *foo it now gives *package'foo.

Along with these, there is now a "caller" function which returns
the context of the current subroutine call. See the man page for
more details.

Chip Salzenberg sent the patches for System V IPC (msg, sem and shm)
so I dropped them in.

There was no way to wait for a specific pid, which was silly, since
Perl was already keeping track of the information. So I added
the waitpid() call, which uses Unix's wait4() or waitpid() if
available, and otherwise emulates them (at least as far as letting
you wait for a particular pid--it doesn't emulate non-blocking wait).

For use in sorting routines, there are now two new operators,
cmp and <=>. These do string and numeric comparison, returning
-1, 0 or 1 when the first argument is less than, equal to or
greater than the second argument.

Occasionally one finds that one wants to evaluate an operator in
a scalar context, even though it's part of a LIST. For this purpose,
there is now a scalar() operator. For instance, the approved
fix for the novice error of using <> in assigning to a local is now:

local($var) = scalar(<STDIN>);

Perl's ordinary I/O is done using standard I/O routines. Every
now and then this gets in your way. You may now access the system
calls read() and write() via the Perl functions sysread() and
syswrite(). They should not be intermixed with ordinary I/O calls
unless you know what you're doing.

Along with this, both the sysread() and read() functions allow you
an optional 4th argument giving an offset into the string you're
reading into, so for instance you can easily finish up partial reads.

As a bit of syntactic sugar, you can now use the file tests -M, -A
and -C to determine the age of a file in (possibly fractional) days
as of the time the script started running. This makes it much
easier to write midnight cleanup scripts with precision.

The index() and rindex() functions now have an optional 3rd argument
which tells it where to start looking, so you can now iterate through
a string using these functions.

The substr() function's 3rd argument is now optional, and if omitted,
the function returns everything to the end of the string.

The tr/// translation function now understands c, d and s options, just
like the tr program. (Well, almost just like. The d option only
deletes characters that aren't in the replacement string.) The
c complementes the character class to match and the s option squishes
out multiple occurrences of any replacement class characters.

The reverse function, used in a scalar context, now reverses its
scalar argument as a string.

Dale Worley posted a patch to add @###.## type fields to formats.
I said, "Neat!" and dropped it in, lock, stock and sinker.

Kai Uwe Rommel sent a bunch of MSDOS and OS/2 updates, which I (mostly)
incorporated. I can't vouch for them, but they look okay.

Any data stored after the __END__ marker can be accesses now via
the DATA filehandle, which is automatically opened onto the script
at that point. (Well, actually, it's just kept open, since it
was already open to read the script.)

The taintperl program now checks for world writable PATH components,
and complains if any are found (if PATH is used).

Bug fixes:

It used to be that you could get core dumps by such means as

@$foo=();
@foo[42];

(1,2,3)[42];

$#foo = 50;
foreach $elem (@foo) {
$elem = 1;
}

This is no longer so. (For those who are up on Perl internals, the
stack policy no longer allows Nullstr--all undefined values must
be passed as &str_undef.)

If you say something like

local($foo,$bar);

or

local($initialized,$foo,$bar) = ('one value');

$foo and $bar are now initialized to the undefined value, rather
than the defined null string.

Array assignment to special arrays is now better supported. For
instance, @ENV = () clears the environment, and %foo = () will
now clear any dbm file bound to %foo.

On the subject of dbm files, the highly visible bugs at patchlevel
28 have been fixed. You can now open dbm files readonly, and you
don't have to do a dummy assignment to make the cache allocate itself.

The modulus operator wasn't working right on negative values because
of a misplaced cast. For instance, -5 % 5 was returning
the value 5, which is clearly wrong.

Certain operations coredumped if you didn't supply a value:

close;
eof;

Previously, if the subroutine supplied for a sort operation didn't
exist, it failed quietly. Now it produces a fatal error.

The bitwise complement operator ~ didn't work on vec() strings longer
than one byte because of failure to increment a loop variable.

The oct and hex functions returned a negative result if the highest
bit was set. They now return an unsigned result, which seems a
little less confusing. Likewise, the token 0x80000000 also produces
an unsigned value now.

Some machines didn't like to see 0x87654321 in an #ifdef because
they think of the symbols as signed. The tests have been changed
to just look at the lower 4 nybbles of the value, which is sufficient
to determine endianness, at least as far as the #ifdefs are concerned.

The unshift operator did not return the documented value, which
was the number of elements in the new array. Instead it returned
the last unshifted argument, more or less by accident.

-w sometimes printed spurious warnings about ARGV and ENV when
referencing the arrays indirectly through shift or exec. This
was because the typo test was misplaced before the code that
exempts special variables from the typo test.

If you said 'require "./foo.pl"', it would look in someplace like
/usr/local/lib/perl/./foo.pl instead of the current directory. This
works more like people expect now. The require error messages also
referred to wrong file, if they worked at all.

The h2ph program didn't translate includes right--it should have
changed .h to .ph.

Patterns with multiple short literal strings sometimes failed.
This was a problem with the code that looks for a maximal literal
string to feed to the Boyer-Moore searching routine. The code
was gluing together literal strings that weren't continuous.

The $* variable controls multi-line pattern matching. When it's
0, patterns are supposed to match as if the string contained a
single line. Unfortunately, /^pat/ occasionally matched in middle
of string under certain conditions.

Recently the regular expression routines were upgraded to do
{n,m} more efficiently. In doing this, however, I manufactured
a couple of bugs: /.{n,m}$/ could match with fewer than n characters
remaining on the line, and patterns like /\d{9}/ could match more
than 9 characters.

The undefined value has an actual physical location in Perl, and
pointers to it are passed around. By certain circuitous routes
it was possible to clobber the undefined value so that it
was no longer undefined--kind of like making /dev/null into
a real file. Hopefully this can't happen any more.

op.stat could fail if /bin/0 existed, because of a while (<*>) {...
This has been changed to a while (defined($_ = <*>)) {...

The length of a search pattern was limited by the length of
tokenbuf internally. This restriction has been removed.

The null character gave the tokener indigestion when used as
a delimiter for m// or s///.

There was a bunch of other cleanupish things that are too trivial
to mention here.

Certain systems, notable Ultrix, set the close-on-exec flag
by default on dup'ed file descriptors. This is anti-social
when you're creating a new STDOUT. The flag is now forced
off for STDIN, STDOUT and STDERR.

Some yaccs report 29 shift/reduce conflicts and 59 reduce/reduce
conflicts, while other yaccs and bison report 27 and 61. The
Makefile now says to expect either thing. I'm not sure if there's
a bug lurking there somewhere.

The defined(@array) and defined(%array) ended up defining
the arrays they were trying to determine the status of. Oops.

Using the status of NSIG to determine whether <signal.h> had
been included didn't work right on Xenix. A fix seems to be
beyond Configure at the moment, so we've got some OS dependent
#ifdefs in there.

There were some syntax errors in the new code to determine whether
it is safe to emulate rename() with unlink/link/unlink. Obviously
heavily tested code... :-)

Patch 27 introduced the possibility of using identifiers as
unquoted strings, but the code to warn against the use of
totally lowercase identifiers looped infinitely.

I documented that you can't interpolate $) or $| in pattern.
It was actually implied under s///, but it should have been
more explicit.

Patterns with {m} rather than {m,n} didn't work right.

Tests io.fs and op.stat had difficulties under AFS. They now
ignore the tests in question if they think they're running under
/afs.