Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View
The readdir returns entries from the filesystem hashed unorder.
The record order depends from node names and the hash function.
if you want to have them sorted you have to use a foreach sort ...  
readdir but then you are missing the itterative behaviour of while  
(readdir ...) . Correct me if I am wrong

Re: readdir

On 11/25/2015 09:23, George Mpouras wrote:
Quoted text here. Click to load it

Well obviously you have to read all the entries before you can sort them.  ;)
Normally, I would read them into an array and iterate over the sorted array.

my @files = readdir DIR;
foreach my $file (sort @files) {

Site Timeline