From: A. Sinan Unur on
"Robbie Hatley" <see.my.signature(a)for.my.email.address> wrote in
news:CuSdnZLhluU2BZrVnZ2dnUVZ_oaonZ2d(a)giganews.com:

>
> "A. Sinan Unur" wrote:
>> On a hunch, could you check what the following script prints:
>>
>> #!/usr/bin/perl
>>
>> use strict;
>> use warnings;
>>
>> use Fcntl;
>>
>> my $EXLOCK = eval {
>> local $SIG{__DIE__} = sub {};
>> local $SIG{__WARN__} = sub {};
>> &Fcntl::O_EXLOCK();
>> };
>>
>> print "'$EXLOCK'\n";
>>
>> __END__
>
> Hmmm. That gives:
>
> cwd = C:\
> $p einval.p
> Use of uninitialized value in concatenation (.) or string at
> C:\scripts\einval.p line 14.
> ''
> So it's just printing '', since $EXLOCK is uninitialized.
> Whatever that indicates. I'm afraid its going way over my head.

That indicates that the problem flag is one of the other ones.

Here is my guess, File::Temp is OK, but Pod::Perldoc only seems to
check and take care of the shortcomings of Win32. However, the same
shortcomings exist in DJGPP running on Win32 as well. I did look at
MSWin_perldoc_tempfile in Perldoc.pm and it looks like the DJGPP
would need special handling as well.

The only Win32 specific part of the special handling seems to be
getting the tick count for generating a unique filename.

I don't have a DJGPP environment set up right now so I can't test a
patch, but, if you don't care much about filenames being
unguessable, replacing the filename generation algorithm to
something along the lines of

sub DJGPP_perldoc_tempfile {

# skip, see sub MSWin_perldoc_tempfile

# completely untested

my $ext = 'aaa';

do {

# used also in MSWin_temp_cleanup

$spec = catfile(
$tempdir,
sprintf( 'pd%6.6x.%s', time & 0x00ffffff, $ext ),
);
++ $ext;
} while ( -e $spec );

Alternatively, you can try UNLINK => 0 and see if it solves you
immediate problem.

Sorry, I can't investigate this any further without setting up a
DJGPP environment.

Sinan

--
A. Sinan Unur <1usa(a)llenroc.ude.invalid>
(remove .invalid and reverse each component for email address)

comp.lang.perl.misc guidelines on the WWW:
http://www.rehabitation.com/clpmisc/
From: Robbie Hatley on

"A. Sinan Unur" wrote:

> Here is my guess, File::Temp is OK, but Pod::Perldoc only seems to
> check and take care of the shortcomings of Win32. However, the same
> shortcomings exist in DJGPP running on Win32 as well. I did look at
> MSWin_perldoc_tempfile in Perldoc.pm and it looks like the DJGPP
> would need special handling as well.
>
> The only Win32 specific part of the special handling seems to be
> getting the tick count for generating a unique filename.
>
> I don't have a DJGPP environment set up right now so I can't test a
> patch, but, if you don't care much about filenames being
> unguessable, replacing the filename generation algorithm to
> something along the lines of
>
> sub DJGPP_perldoc_tempfile {
>
> # skip, see sub MSWin_perldoc_tempfile
>
> # completely untested
>
> my $ext = 'aaa';
>
> do {
>
> # used also in MSWin_temp_cleanup
>
> $spec = catfile(
> $tempdir,
> sprintf( 'pd%6.6x.%s', time & 0x00ffffff, $ext ),
> );
> ++ $ext;
> } while ( -e $spec );

I'll try that, but i'm not hopeful. The error messages show
different random 10-character file names each time I try
running Perldoc. So perldoc.pm is successfully coming up with
random file names, but they apparently get rejected somewhere.

Hmmm... 10 characters... I wonder if something in the DJGPP
version of Perl or perldoc.pm is expecting 8x3 DOS file names?
If so, it may reject 10x3. How would I go about altering
perldoc.pm to use 8x3 instead of 10x3 temp file names?

> Alternatively, you can try UNLINK => 0 and see if it solves you
> immediate problem.

I think that's one of the things I tried last night, but I'll
make sure after work tonight.

I'm curious: Have any of the others in these two groups had
problems running perldoc on DJGPP on Win2K? Or more to the
point, can anyone here SUCCESSFULLY run DJGPP perldoc on
Win2K? I'm wondering if this is a widespread bug, or just
some fluke of setup of the 2 machines I'm seeing it on.

I know that djgpp perldoc USED to work on Win2k. But after
a hard-disk crash a few months ago, I recreated my djgpp folder
with all the lastest stuff, almost certainly newer versions;
so I'm suspecting this may be a bug in the 5.8.8 version
of djgpp Perl.

Is anyone here running DJGPP and Perl 5.8.8 on Win2K? If so,
please try this: Run Bash, then at Bash prompt type
"perldoc perl". Do you get "invalid argument in perldoc.pm
line 1483"? Or does it work fine?

--
Cheers,
Robbie Hatley
lonewolf aatt well dott com
www dott well dott com slant user slant lonewolf slant


From: A. Sinan Unur on
"Robbie Hatley" <see.my.signature(a)for.my.email.address> wrote in
news:jbednbQ7qIihcJrVnZ2dnUVZ_i2dnZ2d(a)giganews.com:

>
> "A. Sinan Unur" wrote:
>
>> Here is my guess, File::Temp is OK, but Pod::Perldoc only seems
>> to check and take care of the shortcomings of Win32. However, the
>> same shortcomings exist in DJGPP running on Win32 as well. I did
>> look at MSWin_perldoc_tempfile in Perldoc.pm and it looks like
>> the DJGPP would need special handling as well.

....

> I'll try that, but i'm not hopeful. The error messages show
> different random 10-character file names each time I try
> running Perldoc.

The point I was trying to make wasn't about the actual filename
being generated but I was referring to the fact that Windows temp
files required special handling.

> So perldoc.pm is successfully coming up with
> random file names, but they apparently get rejected somewhere.

....

> Hmmm... 10 characters... I wonder if something in the DJGPP
> version of Perl or perldoc.pm is expecting 8x3 DOS file names?
> If so, it may reject 10x3.

Actually, Perldoc.pm generates way more than 10 characters:

perldoc_perlfunc_t4805fd11_1e43f.txt

I don't know where you got 10 from.

> How would I go about altering
> perldoc.pm to use 8x3 instead of 10x3 temp file names?

I used one method in the code I posted: prefix pd, lower 24 bits of
time (6 hex digits) and three character extension.

I only did that to be on the safe side.

Sinan

--
A. Sinan Unur <1usa(a)llenroc.ude.invalid>
(remove .invalid and reverse each component for email address)

comp.lang.perl.misc guidelines on the WWW:
http://www.rehabitation.com/clpmisc/
From: Juan Manuel Guerrero on
Robbie Hatley schrieb:
[snip]
> I'm curious: Have any of the others in these two groups had
> problems running perldoc on DJGPP on Win2K? Or more to the
> point, can anyone here SUCCESSFULLY run DJGPP perldoc on
> Win2K? I'm wondering if this is a widespread bug, or just
> some fluke of setup of the 2 machines I'm seeing it on.

Perl 5.8.8 compiled with djdev203 runs flawlessly on my Win98SE box
and perl 5.8.8 compiled with djdev204 runs flawlessly on my
WinXP box too. I can not reproduce the error you are reporting in
any way.
Even if I let point TMPDIR to a non-existing directory, Perl continues
working without any problem. The rule that Perl uses to create
temporary files is as follows:
1) Evaluate TMPDIR, TMP and TEMP in that order and determinate
if that directory exists *and* is writable. If not descard the
pointer
and try the next environment variable.
2) If non of them worked the try /tmp. This means that it assumes
that the current partition has a /tmp directory. If this is proven
untrue The it defaults to /. It creats the temporary file in the
root directory of the current partition.
It must be noticed that Perl always checks for existance and
for write rights of the directory before trying to create the
file.

The length of the temporary name has no influence;
you use a LFN system.


> I know that djgpp perldoc USED to work on Win2k. But after
> a hard-disk crash a few months ago, I recreated my djgpp folder
> with all the lastest stuff, almost certainly newer versions;
> so I'm suspecting this may be a bug in the 5.8.8 version
> of djgpp Perl.
>
> Is anyone here running DJGPP and Perl 5.8.8 on Win2K? If so,
> please try this: Run Bash, then at Bash prompt type
> "perldoc perl". Do you get "invalid argument in perldoc.pm
> line 1483"? Or does it work fine?
No, it always works on all OS I have tried on different computers.
I am afraid that something is really brocken in your installation.
For some reason the opening of the temporary file is not
possible on your system.

Regards,
Juan M. Guerrero
From: A. Sinan Unur on
"Robbie Hatley" <see.my.signature(a)for.my.email.address> wrote in news:jbednbQ7qIihcJrVnZ2dnUVZ_i2dnZ2d(a)giganews.com:

[ follow-ups set to comp.os.msdos.djgpp ]

> Is anyone here running DJGPP and Perl 5.8.8 on Win2K? If so,
> please try this: Run Bash, then at Bash prompt type
> "perldoc perl". Do you get "invalid argument in perldoc.pm
> line 1483"? Or does it work fine?

OK, I gave in and downloaded all the files on those painfully
slow connections ;-)

bash-2.04$ perldoc -f time
time
Returns the number of non-leap seconds since whatever time the
system considers to be the epoch, suitable for feeding to
.... snip. ..

c:\opt\djgpp\tmp\ReFiSi3BxU (END)

The operating system is Windows XP SP2. LFN=y set.

bash-2.04$ perl -v

This is perl, v5.8.8 built for dos-djgpp-stdio

Copyright 1987-2006, Larry Wall

MS-DOS port Copyright (c) 1989, 1990, Diomidis Spinellis
djgpp v2 port (jpl5003c) by Hirofumi Watanabe, 1996
djgpp v2 port (perl5004+) by Laszlo Molnar, 1997-1999

It looks like you indeed do have a configuration issue.
My original gut feeling was wrong.

Sinan
--
A. Sinan Unur <1usa(a)llenroc.ude.invalid>
(remove .invalid and reverse each component for email address)

comp.lang.perl.misc guidelines on the WWW:
http://www.rehabitation.com/clpmisc/