26 years agoexec() fixed on win32
Gurusamy Sarathy [Mon, 23 Jun 1997 22:49:12 +0000]
exec() fixed on win32

exec() doesn't work right on Win32 because of the UNIX-specific
do_exec().

This patch fixes that, and updates the README.win32 in spots.

p5p-msgid: 199706241525.LAA06554@aatma.engin.umich.edu

26 years agoWin32 sitelib intuition from DLL location
Gurusamy Sarathy [Sun, 22 Jun 1997 05:34:00 +0000]
Win32 sitelib intuition from DLL location

There is code for win32 that determines archlib from the location
of PERL.DLL.  This is only 50% effective, as any sitelib at
the same location is not found.

This simple patch adds that feature.  It is needed for the win32
binary distribution to work in a relocatable fashion.

[editor's note: perhaps only partially applied]

p5p-msgid: 199706231647.MAA23260@aatma.engin.umich.edu

26 years agoMinor fix for pl2bat.bat
Gurusamy Sarathy [Sun, 6 Jul 1997 00:10:22 +0000]
Minor fix for pl2bat.bat

A long time ago, on Tue, 24 Jun 1997 12:02:25 PDT, Warren Jones wrote:
>Scripts created by pl2bat pass themselves to perl with "perl -x -X %0.bat".
>Adding the ".bat" extension to %0 is unnecessary, since "perl -S" will
>try this automatically.  It makes the script impossible to run from
>the MKS Korn shell, since that shell alway invokes batch files using
>the full path and ".bat" extension.  Thus perl ends up getting a file
>name with *two* ".bat" extensions (foo.bat.bat) which doesn't work.
>A patch follows.
>
>Also, does anyone know why pl2bat uses "%1 %2 %3 ..." rather than %* ?
>Admittedly, all this dosish foolery is pretty lame.

%* does not work with 4DOS/NT. I just found out it can be made to
work there by setting C<ParameterChar = *> in the 4nt.ini file.

Since using %* eliminates the 9 arg limit for perl bat files,
I recommend this patch (which includes yours).

Credited: Warren Jones <wjones@tc.fluke.com>

p5p-msgid: 199707061843.OAA23874@aatma.engin.umich.edu

26 years agoEmbedding threaded apps in perl.dll
Gurusamy Sarathy [Fri, 25 Jul 1997 03:56:36 +0000]
Embedding threaded apps in perl.dll

[Resend: I forgot to cc p5p]
On Fri, 25 Jul 1997 17:22:09 EDT, Doug MacEachern wrote:
>> >Were you able to run Apache w/ mod_status & perl?
>>
>> Not yet, maybe tonight.
>
>Now I get "Unhandled execption in Apache.exe(PERL.DLL); 0x...:
>Access Violation."  During perl_alloc(), win32_malloc() tries to
>pIOSubSystem->pfnmalloc(size), but it looks like pIOSubSystem has not
>been initialized at all (0x00000000).  I've poked around, guessing,
>tried adding:
>PERL_SYS_INIT(&argc,&args);
>SetIOSubSystem(&win32stdio);

The first thing I noticed was Apache is threaded, and mod_status
code will be invoked in a thread different from the main one.
The second thing I found out was I couldn't reproduce the problem
when running Apache with perl.dll produced by Borland.

Putting two and one together, I came up with this fix.

Note that another way to fix it would be to initialize
pIOSubSystem in DllMain's DLL_THREAD_ATTACH, but there is
no call for pIOSubSystem to be thread-local in the first
place (it is simply a pointer to an application level
global).

p5p-msgid: 199707261518.LAA24346@aatma.engin.umich.edu

26 years agoSys::Hostname -w unclean in trial 2
Gurusamy Sarathy [Thu, 31 Jul 1997 13:26:00 +0000]
Sys::Hostname -w unclean in trial 2

Subject: [PATCH] trial2: Sys::Hostname -w unclean

The new Sys::Hostname generates a compiler warning.

[editor's note: the base for this one is wrong.  Previously
gethostbyname was called in void context.]

p5p-msgid: 199708032055.QAA14278@aatma.engin.umich.edu

26 years agoMM_Unix.pm nits for Win32 DMAKE
Gurusamy Sarathy [Thu, 31 Jul 1997 13:25:58 +0000]
MM_Unix.pm nits for Win32 DMAKE

This works around some problems DMAKE has with the new
MakeMaker in trial2.

p5p-msgid: 199708032051.QAA14248@aatma.engin.umich.edu

26 years agoperl debugger, win32, and emacs
Jay Rogers [Thu, 31 Jul 1997 01:11:29 +0000]
perl debugger, win32, and emacs

The following patch is necessary for the perl debugger to run under
emacs on a win32 machine.  The "or defined $ENV{EMACS}" is necessary
for the debugger to run under emacs shell-mode as well.

p5p-msgid: 199707311759.NAA13276@crooked-i.mitre.org

26 years agoPATCH: make DBM*_File modules sub-classable
Paul Marquess [Fri, 11 Jul 1997 10:01:43 +0000]
PATCH: make DBM*_File modules sub-classable

Here is a patch to make the DBM*_File modules sub-classable.

The sub-class patch for DB_File will be along presently.

p5p-msgid: 9707121854.AA19472@claudius.bfsec.bt.co.uk

26 years ago[MM] [PATCH] Re: Liblist problems for MSWin32
Gurusamy Sarathy [Wed, 18 Jun 1997 05:40:14 +0000]
[MM] [PATCH] Re: Liblist problems for MSWin32

On Wed, 18 Jun 1997 14:57:37 EDT, Owen Stenseth wrote:
>>>>>> "Sarathy" == Gurusamy Sarathy <gsar@engin.umich.edu> writes:
>    Sarathy> On 18 Jun 1997 12:01:59 MDT, Owen Stenseth wrote:
>    >>  When building the extension on NT I ran into a problem with
>    >> the Liblist.  The linker supported on NT does not understand -L
>    >> or -l switches so the contents of LDLOADLIBS and EXTLIBS cause
>    >> an error in the linker.
>
>    Sarathy> You should try 5.004_01.  I added Liblist support for
>    Sarathy> win32 in that version.  It handles -l and -L flags, as
>    Sarathy> well as default libraries that are sufficient for most
>    Sarathy> purposes. Let me know if it doesn't work for you.
>
>I guess my latest.tgz was not the latest.
>
>    Sarathy> If the problems you describe are with 5.004_01, please do
>    Sarathy> send us your changes.  Thanks.
>
>No but you do use $verbose instead of $Verbose at the very end of the
>_win32_ext sub in the 5.004_01 version.

Aak, that was a poor cut-and-paste job from the VMS code (where $Verbose
is rightfully called $verbose).  Here's a patch, that also incidentally
corrects a typo in the VMS code.

p5p-msgid: 199706182152.RAA20273@aatma.engin.umich.edu

26 years agoRepost of fork() debugger patch
Ilya Zakharevich [Mon, 14 Apr 1997 05:12:18 +0000]
Repost of fork() debugger patch

Here is the repost of what was apparently lost during some turmoil on
p5-p.

Enjoy,

p5p-msgid: 199707252101.RAA11846@monk.mps.ohio-state.edu

26 years agoDB_File 1.15 patch
Paul Marquess [Thu, 17 Jul 1997 10:47:30 +0000]
DB_File 1.15 patch

This patch for DB_File fixes a few minor bugs and adds the sub-class patch.

    Patch from Gisle Aas <gisle@aas.no> to suppress "use of undefined
    value" warning with db_get and db_seq.

    Patch from Gisle Aas <gisle@aas.no> to make DB_File export only the
    O_* constants from Fcntl.

    Removed the DESTROY method from the DB_File::HASHINFO module.

    Previously DB_File hard-wired the class name of any object that it
    created to "DB_File". This makes sub-classing difficult. Now
    DB_File creats objects in the namespace of the package it has been
    inherited into.

p5p-msgid: 9707192117.AA01973@claudius.bfsec.bt.co.uk

26 years agoSys::Hostname should localize $SIG{__DIE__}
Ken Shan [Sun, 6 Jul 1997 11:48:39 +0000]
Sys::Hostname should localize $SIG{__DIE__}

~s Sys::Hostname should localize $SIG{__DIE__}

When Sys::Hostname is trying various methods to get the hostname,
it should localize $SIG{__DIE__}.  Patch follows.  (I'm not sure
if $SIG{__WARN__} should also be localized.)

p5p-msgid: 199707070357.XAA18065@digitas.harvard.edu

26 years agoperl5.004 Time::Local still broken
Mathias Koerber [Wed, 6 Aug 1997 12:00:00 +0000]
perl5.004 Time::Local still broken

lib/Time/Local.pm is still broken under the new perl5.004.

In effect, when starting up it assumes that the tzsec variable
can be filled with the *current* time difference between
localtime and gmtime. However, there are timezones where this

p5p-msgid: 199706260452.MAA22647@dnssec1.singnet.com.sg

26 years agoRemove 'use UNIVERSAL;', switch to UNIVERSAL::isa()
M.J.T. Guy [Thu, 10 Apr 1997 08:55:05 +0000]
Remove 'use UNIVERSAL;', switch to UNIVERSAL::isa()

Subject: Re: UNIVERSAL.pm and import methods

I wrote
> I've a sneaking feeling that I'm the only person who's tried to use
> this.    And as you might guess from my bug reports, I've learnt the
> error of my ways.

I spoke too soon.   There are three uses in the standard distribution.
The attached patch should get rid of them.

Probably worth doing this irrespective of how the UNIVERSAL/import
question is resolved.

p5p-msgid: E0whaZJ-0007BA-00@ursa.cus.cam.ac.uk

26 years agoExporter errors give wrong location
M.J.T. Guy [Fri, 13 Jun 1997 04:08:45 +0000]
Exporter errors give wrong location

If you attempt to import a symbol which a module doesn't export, the
error is reported as in Exporter.pm rather than in the offending module,
because Exporter.pm uses warn instead of carp.    Patch attached.
(Against either 5.004 or 5.004_01.)

p5p-msgid: E0wdJra-0000n8-00@taurus.cus.cam.ac.uk

26 years agoBinary installers for Perl modules
Ilya Zakharevich [Fri, 6 Jun 1997 01:44:10 +0000]
Binary installers for Perl modules

The following patch makes it possible to trivially write a binary
installer for a module on a given platform.

This still leaves a question on binary uninstaller (on platforms where
there is a standard database of installed software, so it may be easy
to hook into it).  Why is the uninstall target of Makefiles disabled?

Enjoy,

p5p-msgid: 199707210006.UAA06165@monk.mps.ohio-state.edu

26 years agoperl4 to perl5.004 converion with debugger problem
M.J.T. Guy [Sun, 15 Jun 1997 07:27:52 +0000]
perl4 to perl5.004 converion with debugger problem

jmm@elegant.com (John Macdonald) wrote
> The other issue is an annoyance rather than a stopper.  As cited
> in perl425traps, "stuff${'var}more stuff" is no longer
> supported, only $::var and ${::var} are recognized with a
> string.  Changing the ' to :: means that the code is no longer
> perl4 compatible.  I don't want to have ongoing work on two
> versions (perl4 and perl5), so the only good workaround, for
> now, is to break the string into:
>
>     "stuff" . $'var . "more stuff"
>
> As I said, it's an annoyance - there's lots of them in the code
> and a significant proportion of the conversions to . would cause
> lines that ought to be wrapped for readability purposes.
>
> Is there any hope of getting the $' syntax recognized within
> strings?  (Sigh, I'm sure it's too late for it to go into
> 5.004_01, though.)

I think it would be a very bad idea to retrofit this.    Having single
quotes which don't start quoted strings is a syntactic ambiguity
nightmare.    Consider soft references such as "stuff${'var'}more stuff".
(I presume that's why it had to be removed.)

You can avoid this problem, and not extend the lines quite as much, by
explicitly including the package name:

     "stuff${main'var}more stuff"

which works compatibly in perl4 and perl5.

Attached is a suggested patch for perltrap.

p5p-msgid: E0wdKJY-00010w-00@taurus.cus.cam.ac.uk

26 years agopatch to 5.004_01 perltrap.pod
John Macdonald [Mon, 7 Apr 1997 13:21:29 +0000]
patch to 5.004_01 perltrap.pod

I noticed that one entry was repeated, and the description for
both didn't really describe the full nature of the trap.

p5p-msgid: 9706231525.AA22790@revenge.elegant.com

26 years agomultiline commands in qx//
Gurusamy Sarathy [Sun, 22 Jun 1997 02:49:16 +0000]
multiline commands in qx//

On Mon, 21 Jul 1997 15:50:03 EDT, Ilya Zakharevich wrote:
>In article <199707202332.TAA05144@aatma.engin.umich.edu>,
>Gurusamy Sarathy  <gsar@engin.umich.edu> wrote:
>> +the system's command shell for parsing (this is C</bin/sh -c> on Unix
>> +platforms, but varies on other platforms).  If there are none, the
>> +argument is split into words and passed directly to execvp(), which is
>> +more efficient.  Note: exec() and system() do not flush your output
>> +buffer, so you may need to set C<$|> to avoid lost output.  Examples:
>
>"If there are none" should be changed to "if command contains no shell
>metacharacters".

Here's a newer version of that doc patch.  Ignore the old one.

p5p-msgid: 199707212350.TAA18496@aatma.engin.umich.edu

26 years agocool quote for perldebug
Greg Bacon [Tue, 29 Jul 1997 04:23:43 +0000]
cool quote for perldebug

A by-product of #perl discussion [sic].  Take it or leave it.

p5p-msgid: 199707292140.QAA28579@adtrn-srv4.adtran.com

26 years ago[BUG] perlembed.pod:power.c example
Doug MacEachern [Thu, 17 Jul 1997 11:04:28 +0000]
[BUG] perlembed.pod:power.c example

I think this one has been around since perlembed.pod first became more
than "Look at perlmain.c and do something like that" :-)  This is on
top of the patch I sent the other day.

p5p-msgid: 199707181344.JAA10565@postman.opengroup.org

26 years agoUpdates to perlguts (repost)
Ilya Zakharevich [Fri, 6 Jun 1997 02:58:12 +0000]
Updates to perlguts (repost)

Enjoy,

p5p-msgid: 199707152223.SAA00776@monk.mps.ohio-state.edu

26 years ago[BUG:PATCH] Missing semicolon message wrong in perldiag
M.J.T. Guy [Thu, 19 Jun 1997 06:00:07 +0000]
[BUG:PATCH] Missing semicolon message wrong in perldiag

This error message is different between the source and perldiag.pod, so
that "use diagnostics;" doesn't pick it up.

I have moved the message to be in the correct collating order,
_ignoring_ the initial TAB.    Is this the right thing to do?
Is the ordering merely for the convenience of humans, or are there
programs which exploit it?    I note that "use diagnostics;" doesn't.

Warning:  This patch inserts a TAB into perldiag  -  make sure it stays
          as a TAB.

p5p-msgid: E0welEn-0002vT-00@taurus.cus.cam.ac.uk

26 years agoMagic info in perlguts, take 2
Stephen McCamant [Wed, 23 Jul 1997 01:34:46 +0000]
Magic info in perlguts, take 2

This patch supersedes the previous one, adding information about 'k',
'f', and 'U', as well as being more specific about 'A', 'a', 'c', 'g',
'L', and 'l'.

p5p-msgid: m0wr6P8-000EYLC@alias-2.pr.mcs.net

26 years agonew perlembed.pod:match.c
Doug MacEachern [Wed, 16 Jul 1997 11:34:17 +0000]
new perlembed.pod:match.c

I didn't see any negative (or positive) feedback on the new version of
the match.c perlembed example I posted in reply to someone's perlbug a
while back.  So, here's a perlembed.pod patch.

p5p-msgid: 199707170355.XAA21370@postman.opengroup.org

26 years agoBetter "Can't locate auto/%s.al in @INC" error documentation
Ilya Zakharevich [Mon, 9 Jun 1997 05:11:58 +0000]
Better "Can't locate auto/%s.al in @INC" error documentation

Subject: Re: perl 5.004_01 query: did something change relating to IO::Handle

In article <1997Jun23.211618.2091741@hmivax>,
Ilya Zakharevich <ilya@math.ohio-state.edu> wrote:
> I *thought* I corrected this message a year or two ago...  The patch
> was probably lost, but it is very easy to restore it:
>
> Best, Ilya
>
> --- ./pod/perldiag.pod.old Mon Jun  9 17:11:58 1997
> +++ ./pod/perldiag.pod Mon Jun 23 18:14:30 1997
> @@ -611,6 +611,12 @@
>  localize a package variable of the same name, qualify it with the
>  package name.
>
> +=item Can't locate auto/%s.al in @INC
> +
> +(F) A function (or method) was called in a package which allows autoload,
> +but there is no function to autoload.  Most probable cause is a misprint
> +in a function/method name.
> +
>  =item Can't locate %s in @INC
>
>  (F) You said to do (or require, or use) a file that couldn't be found

I think the following variant may be even better:

p5p-msgid: 1997Jun24.195847.2091744@hmivax.humgen.upenn.edu

26 years agoDuplicates in perlguts.pod
Hans Mulder [Sun, 15 Jun 1997 11:26:47 +0000]
Duplicates in perlguts.pod

Seven entries in the API listing at the end of perlguts.pod are duplicated:

p5p-msgid: 9707082346.AA13231@ icgned.icgned.nl
private-msgid: 9707082346.AA13231@icgned.icgned.nl

26 years agowork around compiler bug on CX/UX (perl5.004_01)
Tom Horsley [Wed, 30 Jul 1997 01:24:15 +0000]
work around compiler bug on CX/UX (perl5.004_01)

This patch provides a work-around for a compiler bug on CX/UX systems (which
shows up as a failure in the 'w' format of pack). The
CXUX_BROKEN_CONSTANT_CONVERT ifdef flag is added to the hints/cxux.sh
compiler and pp.c is modified to avoid a compile time constant conversion
which fails based on that ifdef.

While I was in the hints file, I also added the magical
-Qtarget=M88110compat compiler option which makes it build code that will
run on both 88110 and 88100 CX/UX machines interchangably.

This patch was generated from a brand new copy of perl5.004_01, so I'm
confident there are no extraneous changes that slipped in. I even built
and tested and it passed all tests.

(I decided to go with option #3 in my previous mail about how to do the patch).

If its too late for 5.004_02, I wouldn't worry - it isn't very critical.

p5p-msgid: 9707301934.AA18594@amber.ssd.hcsc.com

26 years agoFwd: substr("foo", -1000)
M.J.T. Guy [Mon, 7 Jul 1997 12:37:51 +0000]
Fwd: substr("foo", -1000)

Subject: hmmm.

Isn't it weird that

substr("foo", -1000)

is silently converted to substr("foo", 0, 3) while

substr("foo", 1000)

always causes RETPUSHUNDEF and possibly a warning?  I'd say there's
too much code in pp.c:pp_substr.

Credited: Jarkko Hietaniemi <jhi@iki.fi>
Credited: Tim Bunce <Tim.Bunce@ig.co.uk>

p5p-msgid: 9707072304.AA01069@toad.ig.co.uk
private-msgid: 199707100655.JAA14924@alpha.hut.fi

26 years agosemctl broken under Linux
Andreas Schwab [Wed, 2 Jul 1997 10:04:38 +0000]
semctl broken under Linux

semctl(...,[GS]ETALL,...) passes an uninitialized pointer to the syscall.

Credited: Graham Barr <gbarr@ti.com>
Credited: Tim Bunce <Tim.Bunce@ig.co.uk>

p5p-msgid: 9707040912.AA03470@issan.informatik.uni-dortmund.de
private-msgid: 33C38291.2D9302DA@ti.com

26 years agoEnable PERL_DEBUG_MSTATS without -DDEBUGGING_MSTATS
Ilya Zakharevich [Sun, 15 Jun 1997 23:17:08 +0000]
Enable PERL_DEBUG_MSTATS without -DDEBUGGING_MSTATS

Subject: [PATCH]: reduced malloc patch

Since this problems arise again and again on the list, here is the
reduced malloc patch.  It corrects the following problems:

a) several off-by-one in av_make();
b) Growing TMP on conversion number=>string;
c) Uncompatibility of -DDEBUGGING_MSTATS and system malloc;

(The first two problems are fixed by malloc_jumbo_2 as well, but the
2 chunks for "c" - in perl.c - were forgotten in that patch).

Enjoy,

p5p-msgid: 199707150829.EAA01291@monk.mps.ohio-state.edu

26 years agoRe: q and escaping paired delimiters
Gurusamy Sarathy [Sun, 27 Jul 1997 13:00:48 +0000]
Re: q and escaping paired delimiters

On Sun, 27 Jul 1997 19:57:31 EDT, Kenneth Albanowski wrote:
>In fact, the code in toke.c looks a little suspicious, as if a cut'n'paste
>error happened, and the balanced branch didn't get the cleanup it
>deserved. There's a "if term != '\\'" statement that does nothing, for
>example.

Keen. That same deadcode was in one of my post 4_01 patches
too (it does no damage, but like you say it serves no purpose
either).

>Here'a patch over 5.004_01 (although I'd expect it to work with most
>versions) to allow you to escape both the starting and end quotes for q
>(unbalanced and qq is unchanged), and the obligatory addition to the
>tests. If nobody has any complaints, I expect this will be in _02.

The toke.c hunk is "dangerous", in the sense that GNU patch will
apply it to the wrong branch, if it needs to offset the patch
due to later patches having been applied.  This is thanks to
the two branches having the exact same 8 lines of code.

I of course recommend the change you suggest, and to prove
my faith, I attach my own version, which:

   * eliminates the same deadcode in one of my later patches
   * uses the more meaningful names in the balanced branch
   * doesn't provoke the GNU patch problem with inadequate
     context

Credited: Kenneth Albanowski <kjahds@kjahds.com>

p5p-msgid: 199707280516.BAA14055@aatma.engin.umich.edu

26 years agoRe: q and escaping paired delimiters
Kenneth Albanowski [Sun, 27 Jul 1997 06:49:26 +0000]
Re: q and escaping paired delimiters

On Sun, 27 Jul 1997 chrisn@rock.petersons.com wrote:

> $\ = "\n";
> print '\'this\'';
> print q{'this'};
> print q{{this}};
> print q{\{this\}};
>
> I would expect the output to be:
>
> 'this'
> 'this'
> {this}
> {this}

That this should be fixed makes perfect sense to me. You can view easily
view backwhacking both sides as a generalization of backwhacking the quote
for an unbalanced q''.

In fact, the code in toke.c looks a little suspicious, as if a cut'n'paste
error happened, and the balanced branch didn't get the cleanup it
deserved. There's a "if term != '\\'" statement that does nothing, for
example.

Here'a patch over 5.004_01 (although I'd expect it to work with most
versions) to allow you to escape both the starting and end quotes for q
(unbalanced and qq is unchanged), and the obligatory addition to the
tests. If nobody has any complaints, I expect this will be in _02.

Credited: Gurusamy Sarathy <gsar@engin.umich.edu>

p5p-msgid: Pine.LNX.3.93.970727172201.350K-100000@kjahds.com

26 years ago-S flag fixes for DOSISH platforms
Gurusamy Sarathy [Wed, 23 Jul 1997 14:52:28 +0000]
-S flag fixes for DOSISH platforms

This patch supercedes the one posted here by Ilya
(Message-Id: <199707191651.MAA04897@monk.mps.ohio-state.edu>).

There are no changes for Unix platforms over Ilya's
version.  On DOSISH platforms, the initial check in
the current directory (or the actual path to the script,
if supplied) includes searching for valid extensions.

The fact that -S does not do a PATH search if the supplied
filename contains directory separators (on all platforms) is
documented.  This behavior is similar to Unix and DOS shells.

Note -S *does* have an effect on DOSISH platforms even if no
PATH search happens: valid extensions will be checked for if
the file name is not found.

p5p-msgid: 199707250043.UAA02385@aatma.engin.umich.edu

26 years ago$\1 and serious bug in evalling
Ilya Zakharevich [Mon, 9 Jun 1997 21:18:04 +0000]
$\1 and serious bug in evalling

A bug report of several hours ago (that you cannot enter $\1 in
debugger with some combinations of mallocs and ReadLines) is fixed by
this:

p5p-msgid: 199707262127.RAA12883@monk.mps.ohio-state.edu

26 years agoWin32 UNC path causes autoload to fail
Warren Jones [Wed, 18 Jun 1997 09:11:23 +0000]
Win32 UNC path causes autoload to fail

This is a bug report for perl from wjones@tc.fluke.com,
generated with the help of perlbug 1.17 running under perl 5.004.

p5p-msgid: 97Jun18.163826pdt.35714-1@gateway.fluke.com

26 years agoWeirdness in sv_peek()
Stephen McCamant [Sat, 26 Jul 1997 00:55:03 +0000]
Weirdness in sv_peek()

Tom Phoenix writes:
 > On Sat, 26 Jul 1997, Stephen McCamant sent a patch and wrote:
 >
 > > I don't know what to say about this one.
 >
 > Well, it would be nice to tell us what it's supposed to accomplish! :-)

I've given it more thought, and I've thought of something to say. :-)

You've snipped the patch, but here's the gist of it:

Look at sv_peek(), around line 900 of sv.c. What this function does is
build a short description of the contents of an SV, for use in things
like -Ds stack dumps. It starts with an empty SV `t', and appends
various strings to it: the SV's type, its numeric value, etc. When
it's done, it returns the char * (PV) value of the SV. On line 955,
one case in the switch that has the type name ends in `return
tokenbuf'. tokenbuf is not a local variable, but a global one, not
used anywhere else in the function, that holds the last keyword token
that the lexer scanned. Why would the function return it when the SV
happened to be undefined?

I noticed this `weirdness', as I called it in the subject, when
running perl -Dts on a short program that had a bug in it:

/src/perl5.004_01+% dperl -Dts -e 'for ($x) { map(die, 0) }'

EXECUTING...

    =>
(-e:0)  enter
    =>
(-e:0)  nextstate
    =>
(-e:1)  pushmark
    =>  *
(-e:1)  gvsv(main::x)
    =>  *  die
(-e:1)  gv(main::_)
    =>  *  die   GV()
(-e:1)  enteriter
    =>  die
(-e:1)  iter
    =>  die   SV_YES
(-e:1)  and
    =>  die
(-e:1)  nextstate
    =>  die
(-e:1)  pushmark
    =>  die   *
(-e:1)  const(IV(0))
    =>  die   *  IV(0)
(-e:1)  mapstart
    =>  die   *  IV(0)  ***
(-e:1)  pushmark
    =>  die   *  IV(0)  ****
(-e:1)  die
Died at -e line 1.
Attempt to free unreferenced scalar.

Notice the large number of `die's. If I didn't know better, I'd think
perl was threatening me.

At the time I mailed the patch, the presence of that line in sv_peek()
didn't make any sense at all to me -- a total non sequitur. I
considered writing something about my puzzlement (even checking how to
spell `non sequitur'), but I couldn't think of anything fitting to
say.

In the time since, I've come up with a theory of where that line came
from. I don't have the source for any old 5.0 versions handy, but I
realized I did have a debugging binary of 5.003_07, and it didn't have
the bug. I now think this bug was introduced late in the 5.003_9?
series when Chip decided to fix every buffer overflow he could
find. Specifically, I theorize, sv_peek used to use tokenbuf to hold
the string it was working on, but it was changed to use an SV instead
of a fixed size buffer (that the SV was called `t' was a clue). The
fact that this line wasn't updated can then be chalked up to simple
oversight, and my sense of the order of the universe is intact.

Turns out I can say a lot about this, if I put my mind to it.

p5p-msgid: m0wsEMU-000EYLC@alias-2.pr.mcs.net

26 years agoMinor Win32 glitch with -S flag
Warren Jones [Thu, 19 Jun 1997 09:57:20 +0000]
Minor Win32 glitch with -S flag

This is a bug report for perl from wjones@tc.fluke.com,
generated with the help of perlbug 1.17 running under perl 5.004.

p5p-msgid: 97Jun19.150511pdt.35717-2@gateway.fluke.com

26 years agoFix double form() in XS version check
Chip Salzenberg [Wed, 6 Aug 1997 12:00:00 +0000]
Fix double form() in XS version check

p5p-msgid: 199707210518.BAA13771@nielsenmedia.com

26 years ago-p does not check for failure of implicit print
Dominic Dunlop [Sun, 15 Jun 1997 23:36:14 +0000]
-p does not check for failure of implicit print

Unlike modern incarnations of, say, awk and sed, perl -p does not check the
return status of the implicit print statement executed for each input
record.

Here's a patch against 5.004_01.  ('ware wrapping: there's a long line
in it.)  There's no test case: I couldn't think up a reliable,
portable and polite way of inducing a write error.

I think, in the specific case of the implicit print in -p, this is
non-controversial, and can go in the maintenance branch.  That's not to say
that there are not programs using -p out there (probably CGI scripts) which
will surprise people by exiting noisily on encountering an error, rather
than continuing to do thewrong thing quietly.  Does anybody know of any
widespread examples?  Do we care?

More controversial error checking patch for implicit close of <ARGV>
to follow in separate bug report.

p5p-msgid: v0311070aafea3fa83061@[194.51.248.75]

26 years agosv_vcatpvfn hogs memory [Patch included]
Matthias Neeracher [Sat, 21 Jun 1997 04:38:35 +0000]
sv_vcatpvfn hogs memory [Patch included]

This is a bug report for perl from neeri@iis.ee.ethz.ch

For each %x element to be inserted, sv_vcatpvfn grows the sv to SvLEN +
the size of the element. I strongly suspect that this is a typo, as this
totally defeats the purpose of the sv_grow buffering and leads to huge
sv's with most memory unallocated.

I have included a patch that I believe to be correct; I am not 100% sure
whether the "+1" is needed, too, but I suspect that it is.

As an aside, from my past two bug reports, I'm starting to believe that
it might be worthwhile to add monitoring of memory consumption to the
execution of the perl test suite: I noticed the bug when the execution of
the seemingly innocuous comp/colon.t failed with an out of memory error
attempting to allocate a huge (>10M) sv. I assume that the execution of
comp/colon.t on an UNIX system would consume just as much memory, but is
not usually noticed because a VM system can easily absorb this. Adding
memory consumption figures to the test reports, if this is possible to do
in a portable way, might uncover more bugs like this.

p5p-msgid: 199706211521.RAA12778@solar.ethz.ch

26 years agoinfinite recursion in malloc() with some compile flags
Hans Mulder [Sun, 15 Jun 1997 11:26:35 +0000]
infinite recursion in malloc() with some compile flags

Apologies if you see this twice, but I'm afraid my first attempt
fell into a black hole.  Neither Achim's archive nor the NNTP
gateway seem to have recieved it.

If one tries to compile perl with all of
-DPACK_MALLOC -DHIDEMYMALLOC -DUSE_PERL_SBRK -DPERL_SBRK_VIA_MALLOC
then it's almost certain that miniperl will overflow the C stack on
its first attempt to call malloc().

This happens because with -DPACK_MALLOC Perl_malloc() expects sbrk()
to return 2K-aligned blocks and Perl_sbrk() provides the same sort
of alignments as the system malloc(), i.e. 8 bytes or so.

When Perl_malloc() notices the block returned by sbrk() isn't properly
aligned, it tries to croak("panic: Off-page sbrk").  Croak() calls
mess(); mess() calls mess_alloc(); mess_alloc() calls Perl_malloc();
Perl_malloc() again calls croak() and so on until the C stack overflows.

I see two problems here;

1. With -DPACK_MALLOC, Perl_sbrk() should return 2K-aligned blocks.
2. croak() should not recurse infinitely.

The patch below deals with #1.  I'll think some more about #2.

p5p-msgid: 199706240050.CAA10550@xs2.xs4all.nl

26 years agobless file handles as FileHandle if loaded else IO::Handle
Gisle Aas [Tue, 24 Jun 1997 03:46:11 +0000]
bless file handles as FileHandle if loaded else IO::Handle

Subject: Re: More info regarding the Can't locate error message [PATCH]

lvirden@cas.org (Larry W. Virden) writes:

> use FileHandle;
> STDERR->open("/tmp/errorsfile","w");

This patch tries to fix the problem by auto-blessing handles as
'FileHandle' if the FileHandle package has been loaded and IO::Handle
otherwise.  The snag is that STDOUT, STDIN, STDERR are initialized
before 'use FileHandle' executes, so they are all initially blessed as
IO::Handles.  We compensate by reblessing them in FileHandle.pm:

This makes Larry's example as well as the following code work:

  use FileHandle;
  open(F, "/dev/null") or die;
  F->seek(0, 1) or die;

p5p-msgid: hyb80drrz.fsf@bergen.sn.no

26 years agoAvoid core dump on some paren'd regexp matches
Hugo van der Sanden [Sat, 14 Jun 1997 04:14:33 +0000]
Avoid core dump on some paren'd regexp matches

In article <199706260526.XAA01060@lunkwill.ml.org> Jason wrote:
:This script causes Perl to dump core with a segmentation fault under
:Linux as well as HP-UX.  Here's the script:
:
:#!/usr/local/bin/perl
:@justalist = ("foo\nbar" =~ /(\s|(foo)|(bar))*/ );

It does the same under 5.004_01. The reason is that on the second match
it tried to match (foo) and succeeded, leaving startp[2] and endp[2]
pointing to the beginning and end of the matched 'foo'. On the third
match, it tried to match (foo) and failed; in doing so, it overwrote
startp[2] with the startpoint it was trying to match ('bar'), but left
endp[2] unaltered.

If that third match had failed, no problem would occur - it would
restore startp[] and endp[] from saved copies. However, because the
third match then succeeded on the final alternate the modified
startp[] and endp[] were retained, leaving a mismatched pair of values
for $2.

The solution depends on what the answer should be - one interpretation
is that, since (foo) failed to match the last time it was tried, the
results should be ('bar', undef, 'bar'). The first patch below effects
this. Alternatively, you could say that it was more correct and/or
more useful for it to return the last successful match on (foo), in
which case you want the rather more complicated second patch below.

I'm not an expert on this stuff - Ilya, can you take a look at these
patches and tell me how broken they are, please?

My own feeling is that the second interpretation is more useful, but
I have much less confidence in the completeness of my patch for this.
No test cases supplied at this stage: Jason's testcase above should
suffice for the moment. Perl passes all tests here with either patch.

p5p-msgid: 199706261236.NAA03472@crypt.compulink.co.uk

26 years agoUNIVERSAL.pm and import methods (tests)
M.J.T. Guy [Tue, 1 Apr 1997 13:39:21 +0000]
UNIVERSAL.pm and import methods (tests)

Hugo van der Sanden <hv@crypt.compulink.co.uk> wrote
>                              I find this form:
>
>   if (ref($from) &&
>       (UNIVERSAL::isa($from,'GLOB') || UNIVERSAL::isa($from,'IO::Handle'))) {
>
> really ugly. Has it been determined that UNIVERSAL can't simply be fixed in
> a way that avoids propagating the import?

I agree it's not very pretty.   But my feeling is that this is something you
don't do very often.    The File:: modules are something of a special
case, because of all the GLOB vs ref GLOB vs FileHandle vs IO:: stuff.
The four examples displayed in my patch really ought to be wrapped up
in some central routine, perhaps in IO::Handle.

My original message suggested two alternative methods.

I think (3) Kludge it is too disgusting to contemplate, but it's easy
enough to do.    Perhaps someone can suggest a more elegant variant of the
theme.

I was originally in favour of (4) Hide it, but I've since observed
that the PODs are full of suggestions that you can add a method
to _all_ classes by defining UNIVERSAL::method.    Which pretty much rules
out hiding.

> I also still feel that $object->isa('UNIVERSAL') should be true for any
> blessed reference - I tried asking about this a few times before, but
> never received an answer. As it currently stands, it will be true only
> if UNIVERSAL has been explicitly added to the package's @ISA, which to
> my mind should have no effect at all.

How quaint!    I can't say I'd noticed that anomaly in my poking about.
The attached patch fixes that.    It also radically extends the tests
for UNIVERSAL.

(The new tests assume that my patch to UNIVERSAL.pm has been done.)

p5p-msgid: E0whfHh-0007bW-00@ursa.cus.cam.ac.uk

26 years agoRe: Calling Perl from within C from within Perl
Gurusamy Sarathy [Fri, 13 Jun 1997 03:34:36 +0000]
Re: Calling Perl from within C from within Perl

On Mon, 30 Jun 1997 13:26:33 EDT, Kenneth Albanowski wrote:
>[GIMME after perl_call*() coredumps]
>Is perl_call_sv mucking with the current op? That's the only problem that
>looks vaguely reasonable.

op will be null after perl_call_sv(), and GIMME looks in op to
find the context.  I tend to use GIMME only in the declaration
initializers, so have never run into this trap before.

I recommend this patch.

p5p-msgid: 199706301829.OAA05426@aatma.engin.umich.edu
private-msgid: 199706301842.OAA05569@aatma.engin.umich.edu

26 years agoFix intolerance of a space between "print" and opening paren
Gurusamy Sarathy [Sun, 22 Jun 1997 02:47:36 +0000]
Fix intolerance of a space between "print" and opening paren

On Tue, 01 Jul 1997 09:44:49 BST, "M.J.T. Guy" wrote:
>Gurusamy Sarathy <gsar@engin.umich.edu> wrote
>> (BTW, Perl's intolerance of a space between "print" and the
>> opening paren under -w is quite annoying.)
>
>It may be annoying, but whenever I encounter it, it's _always_ telling me
>about an error.

At least not in these cases:

   perl -we "print (1)"
   perl -we "print (1) if 1"
   perl -we "print (1) unless 0"
   perl -we "print (1) while 0"

The attached patch carries the kludge a little farther to
avoid warnings in the last three cases.

p5p-msgid: 199707011421.KAA15836@aatma.engin.umich.edu

26 years agostringify looses integerness
Gisle Aas [Tue, 1 Jul 1997 22:20:33 +0000]
stringify looses integerness

Gurusamy Sarathy <gsar@engin.umich.edu> writes:

> On 01 Jul 1997 20:49:15 +0200, Gisle Aas wrote:
> >The following patch (relative to perl5.004) makes this bug go away.
> >Perl still passes all it's tests and the original example works as it
> >did in perl5.003.
> >
> >--- sv.c.orig   Tue Jul  1 20:26:40 1997
> >+++ sv.c        Tue Jul  1 20:38:13 1997
> >@@ -1713,6 +1713,7 @@
> >            sv_upgrade(sv, SVt_PVIV);
> >        olderrno = errno;       /* some Xenix systems wipe out errno here */
> >        sv_setpvf(sv, "%Vd", SvIVX(sv));
> >+       SvIOK_on(sv);  /* it is still valid */
> >        errno = olderrno;
> >        s = SvEND(sv);
> >     }
>
> That should restore precisely those flags that were active
> before sv_setpvf() was called. eg: the case where {pIOK,NOK,pNOK}
> are set, the resulting SV should have {pPOK,POK,pIOK,NOK,pNOK}
> set.

NOK or pNOK can't be set at this point.  The only possibility is that
pIOK is set and not IOK (but I don't know how can I trigger this
condition?)

This patch should then be safer (it also passes all tests):

p5p-msgid: hbu4l96z2.fsf@bergen.sn.no

26 years agoEval fails in certain situations (eval "{'...")
Gurusamy Sarathy [Mon, 30 Jun 1997 22:17:12 +0000]
Eval fails in certain situations (eval "{'...")

On Sun, 20 Jul 1997 16:02:05 MDT, Dave Carrigan wrote:
>Eval will fail in the following situation:
>
>- eval'ing a string
>- the string represents an anonymous hash
>- the first key of the anon hash is single quoted, and contains an
>  embedded single quote escaped with a backslash
>- using the form `` $ref = eval $string ''
>
>The MLDBM module uses this form of eval all the time, so the above
>situation actually has the potential to occur quite often.

>$string2 = "{'a\\'' => 'foo', 'b' => 'bar', 'c' => 'bat'}";

That is one of the cases where the note in perlref (about
disambiguating braces not preceded by anything else) applies.

However, in this particular case, the code that recognizes if
a literal string is the first thing inside the curlies is not
doing a thorough job of it.  The attached patch should cure
it.

Note that you'll still need to write C<eval "{ $a => 'foo' }">
as C<eval "+{ $a => 'foo' }"> if you want it to evaluate as a
hashref.  Perl only auto-disambiguates if the first thing in
the curlies is a literal string followed by a comma or =>.

I'll change MLDBM to conform, for the next release.

p5p-msgid: 199707211753.NAA14940@aatma.engin.umich.edu

26 years agoDo not constant-fold ops that depend on locale if C<use locale>
Chip Salzenberg [Wed, 6 Aug 1997 12:00:00 +0000]
Do not constant-fold ops that depend on locale if C<use locale>

p5p-msgid: 199707210519.BAA13785@nielsenmedia.com

26 years agoRe: Can't pack literals as pointers
John Tobey [Tue, 24 Jun 1997 11:44:33 +0000]
Re: Can't pack literals as pointers

MHO, pack("p","foo") should evaluate to a pointer that's valid in the
urrent context.  pack("p",undef) should return the NULL value.
urrently, they both produce the error "Modification of a read-only
alue attempted".

This looks pretty easy to fix, so I've prepared a diff against the
5.004_01 distribution.  This tests fine on my Linux.  I hope I'm not
introducing a memory leak or other ailment...

Credited: Tim Bunce <Tim.Bunce@ig.co.uk>
Credited: Gurusamy Sarathy <gsar@engin.umich.edu>

26 years agoRe: Bug in Regular Expressions when using colon as delimiter
M.J.T. Guy [Mon, 7 Jul 1997 06:02:29 +0000]
Re: Bug in Regular Expressions when using colon as delimiter

Andreas Klussmann <andreas@infosys.heitec.net> wrote
> using
>    $x =~ m:(?:xx):;
> instead of
>    $x =~ m:(?\:xx):;
> terminates perl immediatly (not in the debuger) and gives
>    Sequence (?
> and nothing more as error message.

This illustrates at least three bugs:

i)   The message is truncated because of the "NUL in argument to die"
     problem which I reported some time ago (and provided a kludge for
     in Carp.pm).

ii)  In any case, it would have produced an incorrect error message.

iii) This error and many (most? all?) other parsing errors in regular
     expressions cause compilation to be terminated.

The attached patch fixes (i) and (ii) but not (iii).    It also extends
the regexp tests to test the error messages generated rather than just
note that an error has occurred.

Additional points which I'll leave to someone else:

a)  (iii) needs fixing.

b)  I note that many regexp error messages are incorrect, as they quote
    the regexp as /(?/ rather than as (e.g.) m:(?: or s:(?::.

c)  My understanding of Chip's rework of sprintf was that it now provided
    a mechanism for including strings with embedded NULs.   Could this
    be used to provide a complete fix for (i) rather than kludging each
    case as it turns up?

d)  I strongly suspect that the regexp tests   a\    and    'a\'i
    are not doing what the author intended.    I've left them so they
    say "ok" regardless.    (Hint:   \' is recognised in a '' string.)

p5p-msgid: E0wtbhv-0005Mm-00@ursa.cus.cam.ac.uk

26 years agoBand-aid fix for local([@%]$x)
Stephen McCamant [Sun, 15 Jun 1997 09:23:45 +0000]
Band-aid fix for local([@%]$x)

This fixes the segfaults by extending the prohibition on `local($$x)'
to array and hash dereferences and removing the code that never
worked. It also adds simple test cases and a `through' to the error
message.

The new explanation in perldiag isn't terribly clear, but the old one
told an untruth.

It should be possible to make local([$@%]$x) work by adding a new
SAVEt type, and I'd like to do so in the future, but that certainly
wouldn't be maintenance patch material.

p5p-msgid: m0wsb7J-000EYPC@alias-2.pr.mcs.net

26 years agoAdditional patch for "Can't execute ..."
Ilya Zakharevich [Sun, 15 Jun 1997 23:17:08 +0000]
Additional patch for "Can't execute ..."

The patch I sent a couple of hours ago was not enough.  In fact
delimcpy() was used wrongly when splitting PATH on dosish systems: '\\'
is not quoting ';' in PATH.

Fortunately, delimcpy() is used in very few places in the source, and
never with ';' as delimiter - outside of PATH context.  So we just fix
delimcpy() when the delimiter is ';'.

Enjoy,

p5p-msgid: 199707181120.HAA03593@monk.mps.ohio-state.edu
private-msgid: 199707191651.MAA04897@monk.mps.ohio-state.edu

26 years ago: HP-UX 10 w/o transition links
Jeff Okamoto [Sun, 15 Jun 1997 22:23:58 +0000]
: HP-UX 10 w/o transition links

This patch is needed because if you run HP-UX 10 and turn off transition
symlinks then /lib goes away and the workaround for the POSIX problem
(2^5 is not exactly 32) won't.  (That workaround should use -L/usr/lib/pa1.1,
not -L/lib/pa1.1 because of the transition link problem)

p5p-msgid: 199706181851.AA093329906@hpcc123.corp.hp.com

26 years agomake Configure recognize powerux hint (perl5.004_01)
Tom Horsley [Wed, 30 Jul 1997 00:01:31 +0000]
make Configure recognize powerux hint (perl5.004_01)

This is my day for building perl on various flavor Concurrent boxes - here's
a minor Configure patch for a different operating system.

Version 5.004_01 seems to build, link, and pass all tests perfectly "out of
the box" on Concurrent's PowerMAX OS, but because marketing keeps changing
the name of the operating system, Configure needs a small patch to recognize
all the possible versions of uname output and pick the right hint file. (I
suppose it would make marketing happier if I renamed powerux.sh to
powermax.sh, but I have the feeling they'll change the name again real soon
now, so I'm just gonna leave the hints file with the name it already has
:-).

I did try this patch, and it seemed to recognize the proper hints file
correctly when I built.

p5p-msgid: 9707301938.AA08352@amber.ssd.hcsc.com

26 years agoConfigure can't find open3 on NeXTstep
Hans Mulder [Fri, 27 Jun 1997 06:32:59 +0000]
Configure can't find open3 on NeXTstep

A buglet in Configure casuses it to not find the 3-argument
form of open(2) on some platforms.  The problem is that it
tries to compile open3.c using $cc $cppflags.  On a NeXT
with MAB support, this will cross-compile for the first
architecture on the list.  If that isn't the architecture
Configure is running on, the resultant binary cannot be run.
This leads Configure to believe that open3 is not available.

P.S. A relevant detail not mentioned in the site configurion
summary below, is that I'm compiling on an HP/PA workstation.

Credited: Andy Dougherty <doughera@newton.phys.lafayette.edu>

p5p-msgid: 9706271816.AA10551@ icgned.icgned.nl
private-msgid: 9706271816.AA10551@icgned.icgned.nl

26 years agom2t3: Configure: cf_time always in C locale
Jarkko Hietaniemi [Tue, 5 Aug 1997 22:08:04 +0000]
m2t3: Configure: cf_time always in C locale

So that the $Config{cf_time} is in English format.
Technique similar to that of forcing awk to use . as the radix character.

p5p-msgid: 199708061827.VAA09623@alpha.hut.fi

26 years ago[dummy merge]
Tim Bunce [Wed, 6 Aug 1997 12:00:00 +0000]
[dummy merge]

This merge exists so that the p5p version of the patch and the applied
version are both in the history

26 years agoh2ph corrections to avoid redefined sub warnings
Tim Bunce [Wed, 6 Aug 1997 12:00:00 +0000]
h2ph corrections to avoid redefined sub warnings

(this is the same change as commit 46f24c54ba4249e3ea156261098960de79140a11, but as applied)

26 years agoh2ph corrections to avoid redefined sub warnings
wdconsta [Tue, 8 Jul 1997 02:30:44 +0000]
h2ph corrections to avoid redefined sub warnings

Subject: [PATCH] possible h2ph corrections?

i've been getting a whole bunch of redefined sub warnings from my
sys/termios.ph, so here's a fix (well, i don't get the warnings anymore :)

p5p-msgid: Pine.SV4.3.93.970708143446.23808A-100000@florence.teaching.cs.adelaide.edu.au

26 years ago[dummy merge]
Tim Bunce [Wed, 6 Aug 1997 12:00:00 +0000]
[dummy merge]

This merge exists so that the p5p version of the patch and the applied
version are both in the history

26 years agoenable some tests on Win32
Tim Bunce [Wed, 6 Aug 1997 12:00:00 +0000]
enable some tests on Win32

(this is the same change as commit 6328a546c2df884868793e2912ee3da29f24d71f, but as applied)

26 years agoenable some tests on Win32
Gurusamy Sarathy [Mon, 7 Jul 1997 08:07:22 +0000]
enable some tests on Win32

This enables the tests that check $^X, on Win32.

p5p-msgid: 199707250029.UAA02351@aatma.engin.umich.edu

26 years agoAdd xor tests to test suite
Hugo van der Sanden [Thu, 7 Aug 1997 00:00:00 +0000]
Add xor tests to test suite

Subject: Re: Parser nit: possible [PATCH]

In <199706250602.CAA13384@rio.atlantic.net>, Chip Salzenberg writes:
:According to Hugo van der Sanden:
:> Can anyone explain why the parser code for OROP is different from
:> that for ANDOP? I include a patch for what I think it should be,
:> but I don't understand why all tests succeed both with and without
:> this patch.
:Because OROP is a token that's used for both "or" and "xor",
:whereas ANDOP is specific to the single keyword "and".
Ah, in that case the problem is that 'xor' appears nowhere in the
test suite. Patch below adds 4 new tests that normally succeed; my
previous (erroneous) patch causes the first of them to fail.

p5p-msgid: 199706250730.IAA06097@crypt.compulink.co.uk

26 years agofixes for hints/svr4 for UnixWare >= 2.1.1
John Hughes [Thu, 7 Aug 1997 00:00:00 +0000]
fixes for hints/svr4 for UnixWare >= 2.1.1

We've just upgraded from UnixWare 2.1 to 2.1.2 (*See footnote).  I was
supprised to see that I got

d_stdio_cnt_lval='undef'
d_stdio_ptr_lval='undef'

A quick bit of spelunking showed that in the 2.1->2.1.1 upgrade stdio.h
got modified, the _cnt and _ptr fields in FILE* got renamed to __cnt and
__ptr.

Here's a patch to hints/svr4.sh, all tests pass.

p5p-msgid: 199707021230.OAA24230@titanic.AtlanTech.COM

26 years agogetservby*() calls fail on Windows NT
Gurusamy Sarathy [Thu, 7 Aug 1997 00:00:00 +0000]
getservby*() calls fail on Windows NT

This patch is needed to avoid GPFs on calls to getservby*()
on Windows NT, when compiling with the Borland compiler.
The same bug is present on Windows95 when using either
compiler.

The patch simply enables the Windows95 workaround.

p5p-msgid: 199706231654.MAA23276@aatma.engin.umich.edu

26 years ago(3) File::Find::find()/finddepth() bugs with toplevel paths
Conrad E. Kimball [Thu, 7 Aug 1997 00:00:00 +0000]
(3) File::Find::find()/finddepth() bugs with toplevel paths

The File::Find module exhibits the following defects:

1) If the top-level directory is a symbolic link to another directory,
   the find() and finddepth() functions follow that symbolic link and
   traverse that directory.  This behavior is both contrary to the way
   the real find command works and contrary to the way find() and
   finddepth() treat symbolic links that occur lower down in the
   directory hierarchy (which aren't followed).

   Example:

   $ cd $HOME
   $ mkdir findbug; cd findbug
   $ ln -s /usr usr
   $ find usr -print
   usr
   $ find2perl usr -print | perl
   usr
   usr/lost+found
   usr/tmp
   usr/tmp/.zma25637cbbb
   ...

2) If the wanted() function sets $prune = 1 for a toplevel directory,
   the find() function ignores it.  It honors $prune for all lower level
   directories, but not the toplevel ones.  This, too, is contrary to
   the way the real find command works.

   Example:

   $ find /usr -print -prune
   /usr
   $ find2perl /usr -print -prune | perl
   /usr
   /usr/lost+found
   /usr/tmp
   /usr/bin
   /usr/man
   /usr/etc
   /usr/lib
   /usr/netdemo
   /usr/include
   /usr/adm
   ...

3) If finddepth() is passed a toplevel path that is not a directory, it
   fails to set $name before calling the wanted() function.  This, too,
   is contrary to the way the real find command works.

   Example:

   $ cd $HOME
   $ find /dev/null -depth -print
   /dev/null
   $ find2perl /dev/null -depth -print | perl

   $

The following patch corrects all three defects:

p5p-msgid: 199707040045.RAA24459@mailgate2.boeing.com

26 years agoposix.xs broken on VMS 7.1
Dan Sugalski [Thu, 7 Aug 1997 00:00:00 +0000]
posix.xs broken on VMS 7.1

private-msgid: 3.0.2.32.19970718095755.00875ba0@stargate.lbcc.cc.or.us

26 years ago[dummy merge]
Tim Bunce [Wed, 6 Aug 1997 12:00:00 +0000]
[dummy merge]

This merge exists so that the p5p version of the patch and the applied
version are both in the history

26 years agopod2html mangles C<&foo(42);>
Tim Bunce [Wed, 6 Aug 1997 12:00:00 +0000]
pod2html mangles C<&foo(42);>

(this is the same change as commit cbcd949909e8235878afef51bf24ea843fcacde0, but as applied)

26 years agopod2html mangles C<&foo(42);>
Hans Mulder [Sun, 15 Jun 1997 11:26:17 +0000]
pod2html mangles C<&foo(42);>

Pod2html does not handle ampersands inside C<> sequences properly.
For example, C<&foo(42);> is translated to <CODE>&foo(42);</CODE>.
This is wrong: the "&" needs to be translated to "&amp;".

p5p-msgid: 199706250057.CAA10162@xs1.xs4all.nl

26 years agoAllow concurrent mkdir in File::Path::mkpath
Ruben Schattevoy [Thu, 7 Aug 1997 00:00:00 +0000]
Allow concurrent mkdir in File::Path::mkpath

private-msgid: 199707300943.LAA21574@kant.imb-jena.de

26 years agoicmp tweak for IO::Socket
Nick Ing-Simmons [Thu, 7 Aug 1997 00:00:00 +0000]
icmp tweak for IO::Socket

Following patch allows use of :

my $sock  = IO::Socket::INET->new(Proto => 'icmp');

To create an ICMP protocol socket, as use for traditional 'ping'.
On UNIX at least only super-user can do this.

p5p-msgid: 199707041240.NAA21484@pluto.tiuk.ti.com

26 years agoExtUtils-Embed upgrade
Doug MacEachern [Thu, 7 Aug 1997 00:00:00 +0000]
ExtUtils-Embed upgrade

26 years ago[dummy merge]
Tim Bunce [Wed, 6 Aug 1997 12:00:00 +0000]
[dummy merge]

This merge exists so that the p5p version of the patch and the applied
version are both in the history

26 years agoSys::Syslog patch to allow unix domain sockets
Tim Bunce [Wed, 6 Aug 1997 12:00:00 +0000]
Sys::Syslog patch to allow unix domain sockets

(this is the same change as commit 8297ae023be5d5af05b2a7f966169444314ba5aa, but as applied)

26 years agoSys::Syslog patch to allow unix domain sockets
Sean Robinson [Thu, 26 Jun 1997 05:45:25 +0000]
Sys::Syslog patch to allow unix domain sockets

Thank you to Tim Bunce and Tom Phoenix for insights on making the
patched code faster and safer, and pointing out bugs.

  What follows is a "fresh patch over the 5.004_01 version".  So reverse
the previous patch before adding this one just to be safe.

 CHANGES (all recommended by Tim or Tom):

 - fixed bug where wrong variable was undef()ined causing attempts to
change back to INET socket to never occur
 - setlogsock() now croaks on any value other than 'unix' or 'inet'
 - setlogsock() no longer uses pattern matching, but is still
case-insensitive
 - updated documentation

p5p-msgid: 33B31342.7EB16A44@sc.maricopa.edu

26 years agoNet::hostent documentation error
Nat Torkington [Thu, 7 Aug 1997 00:00:00 +0000]
Net::hostent documentation error

perl -pi -e 's/addresses/addr_list/g' .../Net/hostent.pm

p5p-msgid: 199707082222.QAA24728@elara.frii.com

26 years agoIO::File and DB_File pollutes namespace with Fcntl constants
Gisle Aas [Thu, 7 Aug 1997 00:00:00 +0000]
IO::File and DB_File pollutes namespace with Fcntl constants

private-msgid: h205qyijy.fsf@bergen.sn.no

26 years agoProblems with setvbuf
Ilya Zakharevich [Thu, 7 Aug 1997 00:00:00 +0000]
Problems with setvbuf

Nick Ing-Simmons writes:
> > I see two possible solutions:
> >
> > a) correct this on the level of IO.xs (manually check for
> >         IoIFP(sv_2io(ST(0)));
>
> I like adding this code to the else branch.

This is almost as you ask:

p5p-msgid: 199707250040.UAA11000@monk.mps.ohio-state.edu

26 years agoxsubpp patch
John Tobey [Thu, 7 Aug 1997 00:00:00 +0000]
xsubpp patch

The patch below is against the 5.004_01 distribution's xsubpp and
incorporates your changes.

> From: Gurusamy Sarathy <gsar@engin.umich.edu>
>
> On Mon, 30 Jun 1997 03:16:25 EDT, Ilya Zakharevich wrote:
> >John Tobey sent me a remarkable fix for xsubpp bugs with #line
> >directives.  I did check a previous version of his patch, and it
> >worked flawlessly, with the only drawback that it did not #line'ized
> >BOOT directives.
> >
> >Today I got his next version, and he claims it now handles BOOT too.
> >I think it may go even to the maintainance track.
>
> Not until the issues below are resolved.  I've attached a patch
> that fixes all but one.

I believe it's possible to avoid any subprocesses or shell invocations
by using a tied filehandle.

Getting the output filename right will require restructuring xsubpp's
command line interface and changing MakeMaker, whence my ".c" hack.
Given that the previous xsubpp didn't insert any self-pointing line
directives, I figure it's a gain, though by no means perfect.

The tie idea may improve portability at the expense of length and
complexity.  It's worked in my test cases (unlike my last patch, in
which C<splice(@BootCode, 1)> should be C<@BootCode> as you noticed).
However, I feel I'm on thin ice when using TIEHANDLE, and this code
can certainly be smoothed out a bit.

p5p-msgid: 199707010221.CAA01234@remote133

26 years agoDocs of IO::Handle [PATCH]
Ilya Zakharevich [Thu, 7 Aug 1997 00:00:00 +0000]
Docs of IO::Handle [PATCH]

I was caught by the following errors in documentation:

Enjoy,

p5p-msgid: 199707222307.TAA08380@monk.mps.ohio-state.edu

26 years agom2t2 broke CPAN.pm :-(
Andreas J. Koenig [Thu, 7 Aug 1997 00:00:00 +0000]
m2t2 broke CPAN.pm :-(

26 years agom2t3: minor doc patch (to obsolete I18N::Collate)
Jarkko Hietaniemi [Thu, 7 Aug 1997 00:00:00 +0000]
m2t3: minor doc patch (to obsolete I18N::Collate)

p5p-msgid: 199708060732.KAA02675@alpha.hut.fi

26 years ago[BUG:PATCH] dumpvar.pl parses some references incorrectly
M.J.T. Guy [Thu, 7 Aug 1997 00:00:00 +0000]
[BUG:PATCH] dumpvar.pl parses some references incorrectly

dumpvar.pl parses stringified references incorrectly when extrovert
class names are used.    For example,

     x bless {}, '=ARRAY('

will crash the debugger.

Patch (for 5.004_01 or 5.004_02) attached.

p5p-msgid: E0wwAjQ-0004l6-00@ursa.cus.cam.ac.uk

26 years ago[dummy merge]
Tim Bunce [Wed, 6 Aug 1997 12:00:00 +0000]
[dummy merge]

This merge exists so that the p5p version of the patch and the applied
version are both in the history

26 years agoconfessing a carp
Tim Bunce [Wed, 6 Aug 1997 12:00:00 +0000]
confessing a carp

(this is the same change as commit 948f37eb18dbace1def87d7f9339a75821436acd, but as applied)

26 years agoconfessing a carp
Nick Ing-Simmons [Wed, 6 Aug 1997 12:00:00 +0000]
confessing a carp

Tim Bunce wrote:

>
> I'd like to be able to use, or tell people to use, a simple command like:
>
>         PERL_CONFESS=1 bad_script.pl

Does not work for csh folk - they have to do use env or
do setenv.

> or
>         perl -MCarpConfess bad_script.pl

This is a bit like -Mblib - pragma-ish so how about

          perl -Mconfess bad_script.pl

>  [...]
> Note that the whole point is to have a global effect so an alternate Carp
> module would not be appropriate.
>
> I think I prefer the very small change to Carp.pm.

I think I prefer the very small auxillary module:

Credited: Hugo van der Sanden <hv@crypt.compulink.co.uk>
Credited: Tim Bunce <Tim.Bunce@ig.co.uk>

p5p-msgid: 33E79BE2.4E6F@ni-s.u-net.com

26 years ago[dummy merge]
Tim Bunce [Wed, 6 Aug 1997 12:00:00 +0000]
[dummy merge]

This merge exists so that the p5p version of the patch and the applied
version are both in the history

26 years agoWarning from calls using "use Shell"
Tim Bunce [Wed, 6 Aug 1997 12:00:00 +0000]
Warning from calls using "use Shell"

(this is the same change as commit a5bda13b0ef005fbbd13265a362caff51359bbc6, but as applied)

26 years agoWarning from calls using "use Shell"
Andrew Pimlott [Wed, 6 Aug 1997 01:27:23 +0000]
Warning from calls using "use Shell"

On Mon, 28 Jul 1997 15:35:46 -0400 (EDT), Thomas Lowery
<nab2337@dsacnhp1.dsac.dla.mil> wrote:
>
>Following an example from the perldoc Shell produces the following
>warning messages. How do I avoid the warning?
>
>Variable "$cmd" will not stay shared at (eval 1) line 14.
>Variable "$cmd" will not stay shared at (eval 2) line 14.

Under 5.004, Shell.pm triggers this warning for every sub it autoloads.  I
didn't see any response to this message, so here is a simple patch.  It just
makes the named sub an anonymous sub assigned to a glob, suppressing the
warning.

Credited: Andrew Pimlott <andrew@pimlott.student.harvard.edu>

p5p-msgid: 199708061739.NAA14754@pimlott.student.harvard.edu
private-msgid: Pine.SOL.3.91.970806173903.7320H-100000@abel

26 years agosplitpod broken in 5.004_01
Tim Bunce [Thu, 7 Aug 1997 00:00:00 +0000]
splitpod broken in 5.004_01

> From: Hans Mulder <hansmu@xs4all.nl>
>
> Splitpod is broken in 5.004_01.

Darn, my fault.

Thanks for this and your other bug reports. I guess _02 will be
sooner rather than later.

p5p-msgid: 9706241612.AA09119@toad.ig.co.uk

26 years agoDocument use of - in a regex char class.
Dominic Dunlop [Thu, 7 Aug 1997 00:00:00 +0000]
Document use of - in a regex char class.

Subject: [PATCH] Re: regex matcher incorrect

At 13:17 +0200 1997-06-24, Ulrich Windl wrote:
>In a statement like "$_[0] =~ /^([ugoa]+)([+-=])([rwxst]*)$/;" some
>incorrect patterns were matched. As an example "go/rw" was matched.
>Adding a backslash in front of the minus, making "[+\-=]", solved the
>problem.
>
>As this is a non-obvious feature, I'd consider that as a bug. Originally
>the problem was seen on Linux running the same version of Perl.

Thanks Ulrich.  You're right.   While all UNIX-descended regular expression
packages work pretty much the same way in respect how you make "-" a member
of a character class, neither the documentation delivered with Perl nor the
book "Programming Perl" tells you what to do, and they should.  Here's a
patch to apply to the perlre.pod documentation file:

p5p-msgid: v03102804afd578bcef2c@[194.51.248.88]

26 years agodone3/perlbook.pod
Randal Schwartz [Thu, 7 Aug 1997 00:00:00 +0000]
done3/perlbook.pod

26 years agoarguments swapped in perlapio.pod
Hans Mulder [Thu, 7 Aug 1997 00:00:00 +0000]
arguments swapped in perlapio.pod

Three PerlIO functions have their arguments swapped (compared with
their stdio counterparts).  Perlapio.pod gets this almost right:

p5p-msgid: 199706240049.CAA10534@xs2.xs4all.nl

26 years ago[dummy merge]
Tim Bunce [Wed, 6 Aug 1997 12:00:00 +0000]
[dummy merge]

This merge exists so that the p5p version of the patch and the applied
version are both in the history

26 years ago[BUG:47:LOG] Dropped "and" in pod2man
Tim Bunce [Wed, 6 Aug 1997 12:00:00 +0000]
[BUG:47:LOG] Dropped "and" in pod2man

(this is the same change as commit 5d3b0638f4c2cf44af3831abe68fc08048b89bc2, but as applied)

26 years ago[BUG:47:LOG] Dropped "and" in pod2man
Hans Mulder [Sun, 15 Jun 1997 11:26:49 +0000]
[BUG:47:LOG] Dropped "and" in pod2man

Nathan Torkington wrote:

> perlfunc.pod contains:

> For a yet-more-powerful import facility, see L</use> and
> L<perlmod>.

> when pod2man | nroff -man  has its way with this, it comes out as:

>                For a yet-more-powerful import facility, see the
>                use entry elsewhere in this document the perlmod
>                manpage.

> That is, the "and" is dropped.  I've verified this with the pod2man
> that comes with 5.004_01, but I couldn't produce a simple test case in
> 30 seconds.

This is about as simple as I could produce in 50 seconds:

=head1 NAME

foo - bar

=head1 DESCRIPTION

L</foo> and bar

This seems to help:

p5p-msgid: 9707082355.AA13254@ icgned.icgned.nl
private-msgid: 9707082355.AA13254@icgned.icgned.nl

26 years agoMajor goof in XS Tutorial regarding subdirs
Ilya Zakharevich [Thu, 7 Aug 1997 00:00:00 +0000]
Major goof in XS Tutorial regarding subdirs

Subject: [PATCH] Major goof in XS Tutorial (subdirs)

I wondered for a lot of time why I never manage to compile extensions with
debugging enabled if the main Perl library is optimized.  Some time ago
I understood that this is due to the following error in XS tutorial:

p5p-msgid: 199707260920.FAA12453@monk.mps.ohio-state.edu