Hi!
I have strange problems while using opendir / readdir
under MasonHQ. I'm not shure, but it seems to be a perl / modperl / Apache
or Mason Bug.
I have no problem to run the same directly from the shell.

Is the a known bug?

Kind regards
Cornelius Kuschnereit

Environement:
Apache 1.3.19
modperl 1.25
mason 1.01
RedHat 7.0
reiserfs

----------------------------------------------
test1_opendir.html
my little test:
----------------------------------------------
<%init>
        my $directory = qq[/usr/local/apache];
        my $dir;
        my @dirs        = ();

        opendir( DIR, $directory );
        @dirs = readdir( DIR );
        close( DIR );
</%init>
Test --------- <BR>
% foreach $dir (sort @dirs) {
file:<% $dir %>
% }
<<<< <BR>
----------------------------------------------
the (wrong) result:
----------------------------------------------
Test --------- <BR>
file:
file:
file:
file:
file:
file:
file:
file:
file:
file:
file:
file:
file:
file:
<<<< <BR>
----------------------------------------------

----------------------------------------------
test1_opendir.pl
my little (working) test:
----------------------------------------------
#!/usr/bin/perl

my $directory = qq[/usr/local/apache];
my $dir;
my @dirs        = ();

opendir( DIR, $directory );
@dirs = readdir( DIR );
close( DIR );
print "Test --------- \n";

foreach $dir (sort @dirs) {
  print "file: $dir\n";
}
print "<<<<<\n";
----------------------------------------------
the (right) result:
----------------------------------------------
Test ---------
file: .
file: ..
file: bin
file: cgi-bin
file: conf
file: htdocs
file: htdocs_mason_data_cache
file: icons
file: include
file: libexec
file: logs
file: man
file: perlmod
file: proxy
<<<<<
----------------------------------------------




Reply via email to