Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:

Spent five hours trying to find a workaround to this, so now I'm asking the experts.

When I use File::Find it correctly (to my mind) works as expected. Starting from a root folder, it lists all the files in that folder, and THEN dives into each directory to get the results within that.

But when using PHP Recursive RII, it lists the dot files first (such as .htaccess), then goes alphabetical through directories (affiliate, cgi-bin, poppa ...) and then lists the remainder files in the root ar bottom, followed by "_folder" of the root at the bottom! (It looks like it is following the ASCII table, ie dot, a - z, and then "_")

What's also strange is that one script returns 7533 directories / files, and the other 7536. I can't trace the missing files as both are returned in a different format. I tried sort to get them into a natural order, but again both created different text files!

I need both to create a "tree", such that root contains 10 files, and 10 folders, it displays 10 files, and then recurse into the folders. As I say, find::file does this, but the other might need some "flags" I cannot find on 'net

I have also tried Find::File::Rule - which is supposed to be easier - but can only get it to list all directories, or all folders. Not as per the tree format of Find::File !!

find(\&procFiles, "$dir"); open ($fh, ">", "siteFull.txt"); print $fh @file; close ($fh); print "all done"; sub procFiles{ if (-d){ push(@file, "--> DIRECTORY ".$File::Find::name."\n"); } if (-f){ push (@file, $File::Find::name."\n"); } }

The RII may need -or() or piped to second RII. (Appreciate this is PHP, not PERL, but maybe someone has a few pointers