Everyone:
Here's something that myself and my sysadmin guy have been working on
for a bit: opendir appears to be broken for us on a new Apache/mod_perl
installation.
We've tried checking out the mailing list archives but nothing jumpped
out at us along these lines.
Any ideas from anyone? (much more info follows...)
Thanks,
- Richard
(BTW, "use CGI::Carp 'fatalsToBrowser';" causes our installation to
segfault when included in my startup.perl program, which is invoked
from within httpd.conf with 'PerlRequire startup.perl'... just to muddy
the waters some more. :-) )
(BTW 2, do Apache::Registry scripts now allow variable _not_ to have
explicit package declaration and/or explicit lexical declarations?
Damian is showing me a program that he wrote that has neither, and yet
runs under Apache::Registry, and this freaks me out.)
-------- Original Message --------
Subject: open/opendir/readdir fail under latest perl/mod_perl/apache.
Date: Mon, 11 Dec 2000 13:17:59 -0500
From: Damian M Gryski <[EMAIL PROTECTED]>
To: [EMAIL PROTECTED]
I've been trying to use opendir/readdir under mod_perl 1.24 with
apache 1.2.14 under Debian GNU/Linux. The system is an up-to-date
Debian `woody' system, and so is using the .deb of perl 5.6.0
The problem is that while neither opendir nor readdir actually return
errors, they also don't return the results I'm expecting: namely,
the directory contents. Instead, the results consist of a list
containing the correct # of items, but each item is a zero-length
scalar (and _not_ the undefined value!) rather than a filename.
This problem does not occur on a system running mod_perl 1.24
with apache 1.3.12 and perl 5.005_03. I can't find anything in the
changelog for either mod_perl or apache suggesting a change in how
opendir is used.
Here's some example code that fails:
---8< CUT HERE >8---
#!/usr/bin/perl
use strict;
my $some_dir = "/home/dmg";
opendir(DIR, $some_dir) || die "can't opendir $some_dir: $!";
my @files = readdir(DIR);
closedir(DIR);
print "Content-type: text/plain\n\n";
print join("\n", @files), "\n";
exit 0;
---8< CUT HERE >8---
On the working system, it correctly produces the list of files
in my home directory. On the `broken' system, it produces a list
of zero-length strings. (On both systems, it works when run from the
command line.)
TIA,
Damian
--
Damian Gryski
ShadNet Admin
[EMAIL PROTECTED]